Menu

#51 Issue with searching/replacing using regular expressions

open
nobody
Editor (89)
5
2003-06-19
2003-06-19
Anonymous
No

Hi

There are several issues with searching / replacing using
regular expressions in syn 2.1.31.

For example, searching for blank lines using '^\n' works
but search next doesn't move from the first occurance.

Searching for a blank line, using the regular
expression '^\n', and replacing it with other characters
doesn't appear to work either.

I would hope that syn would allow a search for regular
expression '^\n' and replacement with ''. Thus removing
the blank lines.

Searching for the end of a line using '$' doesn't appear
to work either.

I'm sure there are probably more but these were the
first I encountered.

Cheers
Andy Wilson

andy.s.wilson@orange.net

Discussion

  • Ascher Stefan

    Ascher Stefan - 2003-06-20

    Logged In: YES
    user_id=163640

    >For example, searching for blank lines using '^\n' works
    >but search next doesn't move from the first occurance.

    Thank you!

    Danail to fix this in frmEditor TEditor.ExecFindNext,
    TEditor.ExecFindPrev, TEditor.ExecFindNextWord,
    TEditor.ExecFindPrevWord:

    if fHasSelection then // <- Add this line
    CaretX := BlockBegin.x;

    I'll see what else is wrong

     
  • Ascher Stefan

    Ascher Stefan - 2003-06-20

    Logged In: YES
    user_id=163640

    >Searching for the end of a line using '$' doesn't appear
    >to work either.

    Hmm, '^.*$' selects the entire line.

     
  • Anonymous

    Anonymous - 2003-09-23

    Logged In: YES
    user_id=625864

    I tried to use the following regular expression to search
    and replace (ignore the bars, they're delimiters, as the
    replace string has a space):

    Search: |(..)|
    Replace: | \$$0|

    My aim was to replace the selection of "1AB53F04" with " $1A
    $B5 $3F $04" -- but instead, the replacement was " $1AB $53F
    $04", even though the messagebox said "4 replacements made".

     

Log in to post a comment.