Hi,
I would appreciate some orientation on the best way to use regular expressions to define transforms. I guess my basic confusion is that regular expressions are usually defined as recognizers, thus F(str)->(true, false) if there is a match or not. However, to define transforms we are using regular expressions as transformational functions, e.g. F(str)->(another string).
I have come across several possible approaches as to how to use regexes as transformational functions:
-- in the Search manual, the rex command has a "sed" mode that uses special Perl syntax to transform strings.
-- regular-expressions.info describes features such as "backreferences" and "lookarounds" which seem to optionally "capture" or "keep" values ... the language suggests functional uses but unfortunately the writing is not precise.
-- the Splunk web interface and examples in the manuals seem to use features from Perl Compatible Regular Expressions (e.g. (?[FIELDNAME>) to extract substrings.
What approach do you prefer? I am happy to learn another grammar, but would prefer to learn one in particular!
Thanks for your help!
Peter
... View more