Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #9449
    LTT
    Participant

    1.
    I want to replace “{[sS]+?}” with “”.
    “{[sS]+?}” can match multi-line text even when “Regular Expressions Can Match New Line Characters” option is off, if I use Replace Next.
    But when using Replace All, that option has to be enabled.
    Is this by design?

    2.
    For example, if I want to replace something with “x{2030}n”, the Replace with text has to be “x{2030}n” or “x2030n”.

    3.
    Escape sequences are always on when searching from the command line.
    But when I want to search a single “” from the command line, I have to use “\”, not “”.

    #9450
    Yutaka Emura
    Keymaster

    Hello,

    Are you using the normal Find/Replace? Or Find in Files/Replace in Files?

    Thanks!

    #9451
    LTT
    Participant

    Sorry.

    1 and 2 are the normal Find/Replace.
    3 is Find in Files.

    #9452
    Yutaka Emura
    Keymaster

    1. It is possible that the Replace All do not work exactly same as the Replace Next.

    2. Can you please create a sample file, and explain what you expect as a result? You might want to zip your sample file, and send it to [email protected], and please identify yourself as a forum member.

    3. It is possible that you might escape a backslash when you use a command line, and escape again when using escape sequences.

    Thanks!

    #9453
    LTT
    Participant

    Yutaka wrote:
    2. Can you please create a sample file, and explain what you expect as a result? You might want to zip your sample file, and send it to [email protected], and please identify yourself as a forum member.

    For example, the original text:

    1-2-3-4-5-

    My goal:

    1‰
    2‰
    3‰
    4‰
    5‰

    If I replace “-” with “x{2030}n” (which I think is a correct regular expression), the result is:

    1‰n2‰n3‰n4‰n5‰n

    If I use “x2030n”, the result is:

    1‰2‰3‰4‰5‰

    I achieved my goal by using “x{2030}n” or “x2030n”.
    But how to understand the excessive backslash(es)?

    #9454
    Yutaka Emura
    Keymaster

    Hello LTT,

    Thank you for explaining. This was certainly a bug, and I am fixing it for the next minor version – 10.1.0.

    Thanks again!

    #9455
    LTT
    Participant

    Yutaka wrote:
    3. It is possible that you might escape a backslash when you use a command line, and escape again when using escape sequences.

    I don’t get it yet on issue 3. Could you explain a little further please?

    It seems this only happens when the FindWhat string is ended with a backslash. Examples:
    * To find “” (1 backslash), I have to use “\” as the FindWhat string in the command line.
    * To find “” (2 backslashes), I have to use “\\”.
    * To find “a” (an “a” and a backslash), I have to use “a\”.

    But to find “a” (a backslash and an “a”), only “a” is needed. Only this one is in line with my expectations.

    #9456
    Yutaka Emura
    Keymaster

    Hi LTT,

    This is a Windows issue, and not the EmEditor issue. Windows escape and unescape command lines because a double quote (“) and a backslash () has a special meaning. For instance, means so you will need to use to send a backslash and a quote. It is a very complicate matter, so please refer to Microsoft documents in order to understand how to escape command lines. While the command options are documented in the EmEditor Help, this Find in Files command option is not recommended to use directly. It is internally used by EmEditor.

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