Ask HN: Regex on a File or Stream I just ran into this seemingly not that hard issue of trying to match a multi-line regex against a 3Gb text file. What is the right tool for this? grep and perl failed running into PCRE limits. |
Ask HN: Regex on a File or Stream I just ran into this seemingly not that hard issue of trying to match a multi-line regex against a 3Gb text file. What is the right tool for this? grep and perl failed running into PCRE limits. |
github seems to be https://github.com/intel/hyperscan
The regex is dead simple: /Authorization: Basic (.*)\ngrant_type=refresh_token/ "." does not match newline, so I'm basically looking two lines that conform to a template.
Specific cases can be transformed with some grep/awk magic, but IMO the concept of pattern matching against a stream is interesting regardless.