Is your feature request related to a problem? Please describe.
A function to extract parts of a string matching a regular expression
Describe the solution you'd like
Implement a new String function to fulfill this:
a = s.extract_regex(regex, flags )
where:
s is a string to parse
regex is a PCRE regular expression
flags is a string giving RegEx matching flags
a is an array returned of values within the string that match groups in the regex
Describe alternatives you've considered
Functional code that can process specific cases can be written, but generalized regex-based extraction cannot be handled via existing functions.
Additional context
This could be used to extract fields from complex host names.
Is your feature request related to a problem? Please describe.
A function to extract parts of a string matching a regular expression
Describe the solution you'd like
Implement a new String function to fulfill this:
a = s.extract_regex(regex, flags )
where: s is a string to parse regex is a PCRE regular expression flags is a string giving RegEx matching flags a is an array returned of values within the string that match groups in the regex
Describe alternatives you've considered
Functional code that can process specific cases can be written, but generalized regex-based extraction cannot be handled via existing functions.
Additional context
This could be used to extract fields from complex host names.
See https://community.icinga.com/t/regex-and-functions/2565