Page 1 of 1

[Solved] Is there a option, make period(.) do not match \n ?

Posted: Sun Feb 09, 2014 8:45 am
by topsuccess
There is some lines:

API: GetProcAddress="FindWindowW"
API: GetProcAddress="PostMessageW"
API: GetProcAddress="GetProcessWindowStation"
API: GetProcAddress="EnumDesktopsW"
API: GetProcAddress="EnumWindows"
API: GetProcAddress="GetThreadDesktop"
API: GetProcAddress="SetThreadDesktop"
API: GetProcAddress="CloseDesktop"
API: GetProcAddress="EnumDesktopWindows"

In Akelpad 4.8.6, when I search "api.+Enum.+$" with Regular Expression checked, multiple lines be selected. If remove the last '$', all lines will be found. I don't want period(.) match '\n', but I haven't found such a option.

Posted: Sun Feb 09, 2014 10:31 am
by Drugmix
So what's the problem with "api.+Enum.+$"?

Posted: Sun Feb 09, 2014 11:56 am
by topsuccess
I hope to find *only* a line at a time, not multiple lines.

Posted: Sun Feb 09, 2014 12:28 pm
by Drugmix

Code: Select all

api[^\n]+?Enum[^\n]+?$
. matches everything
[^\n] matches everything except \n

Posted: Sun Feb 09, 2014 12:44 pm
by topsuccess
Ah, so do it. Thank you. I try to remove second '?', such as "api[^\n]+?Enum[^\n]+$", and it still works.

Posted: Sun Feb 09, 2014 12:58 pm
by topsuccess
And I saw the following in the manual:

Code: Select all

To make it non-greedy (old behaviour) use "?" after quantifier, like, "\d*?". 
It's why first '?' is needed. Now I know it all. Thanks.

Posted: Sun Feb 09, 2014 1:48 pm
by Drugmix
yrw