Regex: pattern repeated capture – delimit the matching at the end of the pattern - non capture group and lookaheads negative exemple -


i wish match end of text , have match characters , line breaks.

but must exclude beginning of next capture!

what want delimit end of pattern next pattern begins.

i tried replace

[^-] 

by like

(?!-{2}\\*{3}) 

it doesn't work !

so want capture number , want capture whole paragraph (some text) between (--*** x ***)

regex capture

thanks

using regex seems work:

--\*{3}([\d]*)\*{3}(((?!-).*\n)*) 

1st capturing group: digit inside stars.

2nd capturing group: text between "headers"

3rd capturing group: last line of paragraph.

a link regex tested: https://regex101.com/r/xj0gc6/1


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -