- AuthorPosts
- March 10, 2022 at 3:25 am #28089spirosParticipant
Regular expressions checked.
Find:
$
Replace:[\google]
The result is
[google]
To have the result as
[\google]
It needs to be
Replace:[\\google]
However, this is not a problem when it is run via a macro:
document.selection.Replace("$","[/google]",eeReplaceAll | eeFindReplaceRegExp,0);
March 10, 2022 at 3:58 pm #28090Yutaka EmuraKeymasterThe macro should be :
document.selection.Replace("$","[\\\\google]",eeReplaceAll | eeFindReplaceRegExp,0);
March 12, 2022 at 2:00 am #28093spirosParticipantYes, sorry about the macro, my error, I used forward slash instead. The point is whether it makes sense for the replacement of
[\google]
to become[google]
in standard regex and requiring[\\google]
in order to replace as expected.March 12, 2022 at 9:43 am #28094Yutaka EmuraKeymasterI am not exactly sure what your question is. Please write an example, what you expect to match literally, and what EmEditor actually matches.
March 15, 2022 at 3:56 am #28095StefanParticipantspiros mentions that he have to escape the backslash \ in the regex replacement by doubling it to \\
Find: $
Replace: [\google]
(o) Regular Expressionmust be
Replace: [\\google]
(o) Regular Expression.
- AuthorPosts
- You must be logged in to reply to this topic.