'Returns lines of the given ``string`` that match the ``pattern``.
The ``pattern`` is a _glob pattern_ where:
| ``*``        | matches everything |
| ``?``        | matches any single character |
| ``[chars]``  | matches any character inside square brackets (e.g. ``[abc]`` matches either ``a``, ``b`` or ``c``) |
| ``[!chars]`` | matches any character not inside square brackets |
A line matches only if it matches the ``pattern`` fully.
The match is case-sensitive by default, but giving ``case_insensitive``
a true value makes it case-insensitive. The value is considered true
if it is a non-empty string that is not equal to ``false`` or ``no``.
If the value is not a string, its truth value is got directly in Python.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Matching Pattern | ${result} | Wild???? example |
| ${ret} = | Get Lines Matching Pattern | ${ret} | FAIL: * | case_insensitive=true |
See `Get Lines Matching Regexp` if you need more complex
patterns and `Get Lines Containing String` if searching
literal strings is enough.'

def get_lines_matching_pattern(self, string, pattern, case_insensitive=False):

    if is_truthy(case_insensitive):
        pattern = pattern.lower()
        matches = (lambda line: fnmatchcase(line.lower(), pattern))
    else:
        matches = (lambda line: fnmatchcase(line, pattern))
    return self._get_matching_lines(string, matches)
