Menu

#8 Regular Expression $ matches EOF not EOL

open
nobody
None
5
2015-04-14
2008-03-18
Anonymous
No

Regular Expression ^a.*$ replace with test

on a text like:

dsf
ee
sdd
f
a
afdgdfg
rdfgdfg

replaces everything from first occurence of a at beginning of line (line 5 in this case) to End of File resulting in:

dsf
ee
sdd
f
test

OS: WindowsXP SP2
Tested with Versions of Madedit: 0.27 and 0.28

Discussion

  • jojo4u

    jojo4u - 2008-08-26

    Logged In: YES
    user_id=1295915
    Originator: NO

    You don't realize that dot also matches newline in Madedit. The $ matches just as expected. You have to use a non-greedy quantifier to match one line:
    ^.*?$

     
  • jywhltj

    jywhltj - 2015-04-14

    I have added a option for this:
    https://github.com/hltj/wxMEdit/issues/108
    The default value of "Enable dot matching newline" is false. You can enable it in misc tab of option dialog.


    https://wxmedit.github.io/
    wxMEdit is an improved version of MadEdit which has been discontinued.

     

Log in to post a comment.

MongoDB Logo MongoDB