EmEditor (text editor) Forum Index
   EmEditor Core Bug Reports
     Searching for files with regex ">\n" fails
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
hosamaly
Posted on: 1/12/2011 9:12 am
Just popping in
Joined: 8/29/2007
From: Cairo, Egypt
Posts: 5
Searching for files with regex ">\n" fails
I've been trying to search for files containing the following regular expression:

>\n


But it always fails, apparently with a silently swallowed exception. I am using EmEditor 10.0.4 64-bit on Windows 7 Professional. The problem seems to be always reproducible. Could you please check it out?
Yutaka
Posted on: 1/12/2011 10:19 am
Webmaster
Joined: 9/28/2006
From: Redmond
Posts: 2399
Re: Searching for files with regex ">\n" fails
Hello,

Can you please try:

>\r\n



I saw your message on my email inbox, too.

Thanks!


----------------
Yutaka Emura
Developer of EmEditor
http://www.emeditor.com/

CrashNBurn
Posted on: 1/12/2011 10:33 am
Just can't stay away
Joined: 4/8/2010
From:
Posts: 130
Re: Searching for files with regex ">\n" fails
Search for:
Quote:
>$

$ is end of line.
Unless your file contains multiple types of carriage-returns, wherein you'd want to specify a difference between unix \n and windows \r\n, $ should work just fine.
hosamaly
Posted on: 1/17/2011 3:30 am
Just popping in
Joined: 8/29/2007
From: Cairo, Egypt
Posts: 5
Re: Searching for files with regex ">\n" fails
It works, thanks. It would be nice if this could be done automatically based on each file's newline pattern. For now I'll use "(?:\n|\r\n)", but I hope EmEditor can integrate this feature.

Thanks again.
hosamaly
Posted on: 1/17/2011 3:31 am
Just popping in
Joined: 8/29/2007
From: Cairo, Egypt
Posts: 5
Re: Searching for files with regex ">\n" fails
Thanks for the suggestion, but it wouldn't work for me, as I need to capture the newline character itself, as I'm trying to find consecutive empty lines.
CrashNBurn
Posted on: 1/17/2011 7:53 am
Just can't stay away
Joined: 4/8/2010
From:
Posts: 130
Re: Searching for files with regex ">\n" fails
This should work: (?m)\}$\r?\n$\r?\n^O
Except it appears that EmEditor doesn't support ANY Regex options:
(?m), (?i), (?-i), (?g), (?-g)

Quote:
\}$\r?\n$\r?\n^O

in Ted's Notepad for instance, will match:
Quote:
}

OSV


In EmEditor you cannot use multiple "^" or "$", or else it it wrongly errors out with a message about invalid regex.

E.G. this works:
\}\r?\n\r?\nO

I use ?m), ?-i) and ?-g) all the time in AHK scripts, and (?-i) and (?-g) in Total Commander's multi-rename tool.
Deipotent
Posted on: 1/17/2011 12:52 pm
Just can't stay away
Joined: 2/15/2008
From:
Posts: 119
Re: Searching for files with regex ">\n" fails
Will support be added to EmEditor for the features CrashNBurn mentions (eg. multiple ^ and $, and (?m), (?i) etc.) ?
Threaded | Newest First Previous Topic | Next Topic | Top


Register To Post
 
English čeština Deutsch español français italiano 日本語 한국어 Русский 简体中文 繁體中文