Issue
I want to capture the 'HELLO THERE WORLD' lines, but use the start and the end lines. However, it's just taking the last line.
regex: start\n(((\w+) (.+) (.+))\n)+end
examples:
abcd 123 123
start
abcd 123 123
abcd 123 123
abcd 123 123
end
abcd 123 123
In the examples I want all the text between the start and the end to be In 3 groups for each line(group1=abcd,group2=123,group3=123
)
like that:
Solution
(?s)(?!.*?start)^(\w+)\s(\w+)\s(\w+)(?=.*?end)
https://regex101.com/r/fDcMJd/1
Answered By - ZygD Answer Checked By - Marie Seifert (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.