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

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 9
Joined: Sat Apr 14, 2012 3:50 pm

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

Post 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.
Last edited by topsuccess on Sun Feb 09, 2014 1:10 pm, edited 1 time in total.

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post by Drugmix »

So what's the problem with "api.+Enum.+$"?

Offline
Posts: 9
Joined: Sat Apr 14, 2012 3:50 pm

Post by topsuccess »

I hope to find *only* a line at a time, not multiple lines.

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post by Drugmix »

Code: Select all

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

Offline
Posts: 9
Joined: Sat Apr 14, 2012 3:50 pm

Post by topsuccess »

Ah, so do it. Thank you. I try to remove second '?', such as "api[^\n]+?Enum[^\n]+$", and it still works.

Offline
Posts: 9
Joined: Sat Apr 14, 2012 3:50 pm

Post 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.

Offline
Posts: 582
Joined: Mon Apr 08, 2013 9:50 pm
Location: Win7SP1x64, APx64

Post by Drugmix »

yrw
Post Reply