fmeobjects.FMERegex

Inheritance diagram of fmeobjects.FMERegex

FMERegex.findall(inputString)

Return all non-overlapping matches in string, as a list of str.

FMERegex.findlist(inputString)

Return a list yielding match objects over all non-overlapping matches in string.

FMERegex.match(inputString)

If zero or more characters at the beginning of string match this regular expression, return a corresponding match tuple.

FMERegex.search(inputString)

Scan through string looking for the first location where this regular expression produces a match, and return a corresponding match object.

class FMERegex

FME Regex Class

init(regexPattern)

This class provides FME regular expression functionality that is differs from Python’s built-in re module.

Parameters:

regexPattern (str) – Regular expression pattern.

Return type:

FMERegex

Returns:

An FMERegex object.

__init__(*args, **kwargs)
findall(inputString)

Return all non-overlapping matches in string, as a list of str. The string is scanned left-to-right, and matches are returned in the order found.

Parameters:

inputString (str) – Input string to match.

Return type:

list[str]

Returns:

A list of matching strings.

findlist(inputString)

Return a list yielding match objects over all non-overlapping matches in string. The string is scanned left-to-right, and matches are returned in the order found.

Parameters:

inputString (str) – Input string to match.

Return type:

list[tuple[str, int, int]]

Returns:

A list of match tuples of the form (match, start, end), where match is the string segment matching the regular expression pattern, start is the start index of the string segment, and end is the end index of the string segment.

match(inputString)

If zero or more characters at the beginning of string match this regular expression, return a corresponding match tuple.

Parameters:

inputString (str) – Input string to match.

Return type:

tuple[str, int, int]

Returns:

A match tuple of the form (match, start, end), where match is the string segment matching the regular expression pattern, start is the start index of the string segment, and end is the end index of the string segment. None is returned if a match is not found.

search(inputString)

Scan through string looking for the first location where this regular expression produces a match, and return a corresponding match object.

Parameters:

inputString (str) – Input string to match.

Return type:

tuple[str, int, int]

Returns:

A match tuple of the form (match, start, end), where match is the string segment matching the regular expression pattern, start is the start index of the string segment, and end is the end index of the string segment. None is returned if a match is not found.