This content has been marked as final. Show 5 replies
boiscout wrote:Let me summarize what that matches:
I got it. regex tester helped.
- it matches the first `<?` then the `.*` will match the entire line after that first `<?` (the DOT does not match line breaks!) and it will then back-track to the last `?>`
So, what jverd is trying to tell you, that greedy matching will cause:
to be replaced in a string like:
<? B ?> C <? D ?>
If that's want you want, well, fine by me. If not, you may want to make the DOT-STAR reluctant (non-greedy) by adding a question mark after it.
A <? B ?> C <? D ?> E