You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is some kind of a follow up from #171 but the question is somewhat more general.
How would one replace a string by an empty string via a replacement file?
Currently, I'm using \\figref\{.*\} but this replaces with a space (which throws some warnings about spaces before punctuation etc.). Just \\figref\{.*\} (no space at the end) didn't work for me as well.
Maybe you could elaborate too on, how the regexes are evaluated.
Is it possible to use perl regex to specify whether * should be greedy or not?
Does Both search and replace can be regular expressions. mean that one can use backreferences in the regexes? If not what does this mean? That one can use a regex as replacement? (As far as I checked, .* is considered as string not as regex in the replacement 'column')
The text was updated successfully, but these errors were encountered:
I wrote this quite some time ago, but as I see in the code, you can use groups (parentheses) in the find pattern and group references (e.g. $1, etc.) in the replacement pattern --although be warned that there does not seem to be any unit test covering this feature!
As to the way to replace a string by nothing (empty string), indeed I don't think it can be done at the moment. Will think of a way of allowing this...
This is some kind of a follow up from #171 but the question is somewhat more general.
How would one replace a string by an empty string via a replacement file?
Currently, I'm using
\\figref\{.*\}
but this replaces with a space (which throws some warnings about spaces before punctuation etc.). Just\\figref\{.*\}
(no space at the end) didn't work for me as well.Maybe you could elaborate too on, how the regexes are evaluated.
Is it possible to use perl regex to specify whether
*
should be greedy or not?Does
Both search and replace can be regular expressions.
mean that one can use backreferences in the regexes? If not what does this mean? That one can use a regex as replacement? (As far as I checked,.*
is considered as string not as regex in the replacement 'column')The text was updated successfully, but these errors were encountered: