Mastering Batch Editing: Managing Several Replacements Simultaneasternly in EmEditor's Find and Replace Feature

Mastering Batch Editing: Managing Several Replacements Simultaneasternly in EmEditor's Find and Replace Feature

Brian Lv8

Mastering Batch Editing: Managing Several Replacements Simultaneasternly in EmEditor’s Find and Replace Feature

October 14, 2011 at 8:01 am #9733

Stefan

Participant

.

Hi :-)

Me thinks that is how the regex engine works?

You search “,d,” on an string like “10,6,3,12”

The regex will match “,6,”
then it continuous at the very next sign from the rest of the string which is now “3,12”.

As you see your search pattern will not match on “3,12” because there is no “,d,” anymore.

The trick is to not match the comas itself as you do but only take an look if they are present.
That can be fine done by using positive lookbehind and lookahead which EmEditor supports (thanks Yutaka).
For more info about that feature see e.g.: http://www.regular-expressions.info/lookaround.html

Example:
search pattern: “oogl”
positive lookbehind if there is an “G” right before your search pattern: (?<=G)
positive lookahead if there is an “e” just after your search pattern: (?=e)

So RegEx search for:
(?<=G)oogl(?=e)

Will match:
Woogle
Google
Googlo
Google
Foogle

Example for your issue with commas:
(?<=,)(d)(?=,)
01

HTH? :lol:

.

Also read:

  • Title: Mastering Batch Editing: Managing Several Replacements Simultaneasternly in EmEditor's Find and Replace Feature
  • Author: Brian
  • Created at : 2024-10-09 06:26:22
  • Updated at : 2024-10-11 00:38:40
  • Link: https://win-net.techidaily.com/mastering-batch-editing-managing-several-replacements-simultaneasternly-in-emeditors-find-and-replace-feature/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Mastering Batch Editing: Managing Several Replacements Simultaneasternly in EmEditor's Find and Replace Feature