Reputation: 408
I have a simple regular expression: .}
and some simple text: {}}
Why do I get a single match:
{}
I was expecting to get two:
{}
}}
Please see here for the code snippit.
Upvotes: 0
Views: 38
Reputation: 1041
Regex matches are non-overlapping. Maybe some like this is closer to what you want:
/(?=})}/g
I think you actually want look behind not look ahead but this isn't supported on regexr.com because it's not supported in java script
/(?<=})}/g
Upvotes: 1