Sample Header Ad - 728x90

Pcre2grep multiline regular expression

1 vote
0 answers
827 views
I'm trying to create a regular expression to match the first html of a text file with this content: garbage garbage §
test
§ garbage garbage §
test
§ garbage garbage §
test
§ garbage garbage first I tried something similar on regex101.com with PCRE2 and single line mode and it works ok. Then I tried it on Windows with Notepad++ with "dot matches new line" option enabled, it works ok there too. Now I'm trying to do the same on Arch Linux with pcre2grep, i've tried with this regular expression: pcre2grep -o '(?s)' test.txt but it doesn't work and I don't know why because from what i have understood the "(?s)" modifier should enable the PCRE2_DOTALL. How can i create an equivalent regular expression with pcre2grep ?
Asked by debe80 (11 rep)
Oct 17, 2021, 01:46 PM