EmEditor (text editor) Forum Index EmEditor Core Enhancement Suggestions
Extract Text to new document with support for both Find & Replacement Regular Expressions... | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| Deipotent | Posted on: 10/20/2010 5:10 am |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 118 |
Extract Text to new document with support for both Find & Replacement Regular Expressions... One feature I've had the need for recently is the ability to extract text matching a Regular Expression, with the actual text that is extracted matching a Replacement Expression (ie. so you can use back references from the Find RE).
For example, some text I wish to match is as follows: where the numbers can change. When extracted, I want the numbered parts to be swapped, so in this example, the text extracted to the new document would be: So, I use the following Find Regular Expression: and want to use the following Replacement Expression to extract the text to a new line: It would be great if there was an easy way to do this from both the Replace dialog, Replace in Files dialog, and Find bar. For the Replace in Files, it would be handy if there was an option to either put all matches in a single new file, or have separate new documents for each file. Also, maybe the Find plugin could be extended to become a Find/Replace/Extract plugin. With this feature, text could be extracted/mined from files. |
| CrashNBurn | Posted on: 10/20/2010 8:52 am |
Just can't stay away ![]() ![]() Joined: 4/8/2010 From: Posts: 130 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... Find/Replace should be able to enable the "Output bar" to indicate what should be placed there:
1) All Found Text, and 2) All Replaced Text or just 2) All Replaced Text. I thought it was possible, but it appears only the "Find in Files" allows usage of the Output bar for searches. |
| Yutaka | Posted on: 10/20/2010 8:58 am |
Webmaster ![]() ![]() Joined: 9/28/2006 From: Redmond Posts: 2398 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... Hello Deipotent and CrashNBurn,
I will consider those options in future versions. Thanks for your inputs!
|
| Deipotent | Posted on: 11/2/2010 7:18 am |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 118 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... Further to my suggestion, it would be useful if the Output bar could be used to display the extracted text. Even better, would be if this could be updated in realtime, similar to the incremental search, so you can see immediately the extracted text as the Find/Replacement expression is modified.
This would make it far easier to create the correct Find/Replacement expressions, since it would give immediate feedback on what is matched (ie. the current incremental search feature), along with what is extracted. While this real-time updating is probably not feasible for Find/Replace in Files with the option "Look in Subfolders" enabled, it could come in handy when the "Look in Subfolders" is not enabled. |
| Deipotent | Posted on: 11/2/2010 7:18 am |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 118 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... A few more suggestions related to extract text, plus Find/Replace In Files:
1) Ability to exclude file name from search results (ie. the opposite of the "Display File Names Only" option) 2) Similar to (1), but also option to only show matched/extracted text (ie. not the whole line). 3) Incremental Search option on Find/Replace In Files, which will apply to currently active document, to aid creation of Find Expression without the need to switch to normal Find/Replace windows. 4) Option to leave Find/Replace in Files window open after pressing Find button. |
| CrashNBurn | Posted on: 11/2/2010 12:17 pm |
Just can't stay away ![]() ![]() Joined: 4/8/2010 From: Posts: 130 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... I dunno about the live-regex/Incremental search for "In Files"
But XNews.exe has a very useful tool built-in, "Test Regex" Quote: Pattern: (Regex Pattern).*(goes here)\.? |
| Deipotent | Posted on: 1/17/2011 12:33 pm |
Just can't stay away ![]() ![]() Joined: 2/15/2008 From: Posts: 118 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... Quote:
I dunno about the live-regex/Incremental search for "In Files" Quote: But XNews.exe has a very useful tool built-in, "Test Regex" |
| CrashNBurn | Posted on: 1/17/2011 3:15 pm |
Just can't stay away ![]() ![]() Joined: 4/8/2010 From: Posts: 130 |
Re: Extract Text to new document with support for both Find & Replacement Regular Expressions... Merely finding text in a given document (valid regex) is in no way the same functionality as displaying how a given regex breaks up into its various pieces.
These days if a particular regex is being difficult, I'll likely just Run a 3 line AHK script and messageBox the output. |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |




