Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28089
    spiros
    Participant

    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);

    #28090
    Yutaka Emura
    Keymaster

    The macro should be :
    document.selection.Replace("$","[\\\\google]",eeReplaceAll | eeFindReplaceRegExp,0);

    #28093
    spiros
    Participant

    Yes, 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.

    #28094
    Yutaka Emura
    Keymaster

    I am not exactly sure what your question is. Please write an example, what you expect to match literally, and what EmEditor actually matches.

    #28095
    Stefan
    Participant

    spiros mentions that he have to escape the backslash \ in the regex replacement by doubling it to \\

    Find: $
    Replace: [\google]
    (o) Regular Expression

    must be
    Replace: [\\google]
    (o) Regular Expression

    .

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.