Quote:
Originally Posted by Perkin
Use code view, In replace, select more, tick regular expression, tick minimal matching
search for
_(.+?)_
repace with
<i>\1</i>
|
Quote:
Originally Posted by seagull
Didn't work but thanks anyway.
|
This had me puzzled, as I'd likely have suggested the same regex, so I checked Sigil's user manual and found this:
"Non-greedy matching cannot be applied to individual quantifiers. Expressions like abc*?dd are not allowed. Use the Minimal matching option to set minimal matching on the whole expression."
So I tried the regex without the "?":
_(.+)_
- and with "Minimal matching" selected, and it worked fine. It was the "?" that was throwing Sigil's regex engine. Worth knowing for future reference.
Edit: Heh! st_albert beat me to it while I was typing, in fewer words and with an explanation.