Regex $ does not match end of line

2006-01-27
2012-11-13
  • Nobody/Anonymous

    Hi

    Thanks for a really great editor, but I believe you an error in the regex implementation.
    I often use the editor to create e.g. full sql insert statements from a list of data. As part of this process I have to append ); to every line. You would normally do it like this with find / replace

    Find: $
    Replace: );

    However instead of matching every line; 0 lines are matched! So I have to do it like this

    Find: (.)$
    Replace: \1);

    Kind regards
    Per Agerbæk

     
    • Chris Severance

      Chris Severance - 2006-01-27

      As you've noticed, $ doesn't match the end of line character, it matches preceding text at the end of a line. No preceding text means no match.

      The Ctrl+R dialog by the TextFX plugin can search & replace end of line characters without RegEx. The function you want can also be done with Plugins | TextFX Edit | Insert (Clipboard) through lines.

       
      • Nobody/Anonymous

        That doesn't work as it only does it one at time