I have to match groups of strings that have as bounds the “__” char sequence (two underscores)
for instance:
hello __1the_re__ my name is __pe er33__
“1the_re” and “pe er33” should be matched
my problem is defining “a string that doesn’t contain a sequence of characters”
/__((?!__).*)__/
Ive tried this, but it is not working…
thank you!
You’re close:
works. The star must be outside the repeated group so the lookahead is performed at every position, not just right after the leading
__.Since this doesn’t capture the right text (I’m guessing that you want the content between the double underscores to be captured), you probably want