How Does EmEditor Handle Regex? Unveiling Its String Pattern Matching Skills
How Does EmEditor Handle Regex? Unveiling Its String Pattern Matching Skills
Viewing 8 posts - 1 through 8 (of 8 total)
- Author
Posts - September 5, 2010 at 5:02 am #8922
hydra
Member
i have a string that contains 3 characters that vary, it looks like this: board=XYZ
note: sometimes X=Y, or Y=Z (they can be either a letter or a number). thus, sometimes the string will read like this: board=K66.
what i want to do, is to find every instance where the variable pattern looks like “XYY” and switch the order to be “YYX”. can emeditor do this using the regular expression function? or can it only be done via script/macro?
September 5, 2010 at 5:28 am #8923
Yutaka Emura
Keymaster
Hello hydra,
In the Replace dialog box, you can use replace
=(w)(ww)
with
=21
and check Use Regular Expressions.
Please let me know if you have further questions.
Thank you!
September 5, 2010 at 5:51 am #8924
hydra
Member
hi yutaka,
thx for the quick reply, however it doesnt do what i need it to do. allow me to explain:
1. when the pattern “board=XYY” is found, i need it to be changed to “board=YYX”. your above suggestion does this. so far so good.
2. BUT, when the pattern XXY is found, i want it to do nothing! your above suggestion changes all instances of XXY into XYX. this is something i must avoid.
is there any expression that can do both #1 while avoiding #2?
September 5, 2010 at 6:00 am #8925
hydra
Member
if the regular expression function cant do this, can u write a simple script/macro that does this for me?
September 5, 2010 at 6:49 am #8926
Jibz
Member
Try searching for
=(w)((w)3)
and replace with
=21
September 5, 2010 at 7:02 am #8927
hydra
Member
jibz,
such an elegant solution! thank u so much!
September 5, 2010 at 6:54 pm #8928
Yutaka Emura
Keymaster
That’s an excellent solution. Thnaks jibz!
September 6, 2010 at 5:20 am #8929
Jibz
Member
Glad to hear it worked :-). - Author
Posts
Viewing 8 posts - 1 through 8 (of 8 total)
- You must be logged in to reply to this topic.
Also read:
- [Updated] In 2024, Cutting-Edge 4K Tools for Optimal Video Quality
- [Updated] The Roadmap to YouTube Fame Essential Steps for Successful Content
- 如何在Windows系统中回答資源回收桶還原手冊:高效指南
- A Beginner's Guide to Elevating Auditory Experiences on YouTube
- Can Life360 Track You When Your Motorola Moto G13 is off? | Dr.fone
- Decoding Session Identifiers: In-Depth Insights & Key SEO Techniques for Enhanced Online Visibility
- Explore the Past Reverse Video on iOS Devices
- How To Repair and Revive a Non-Functional Toshiba Storage Device
- Verstehen Sie Das Wunder Der Hyper-V Virtualisierung Für Physische Computer: Erleuchtende Tipps Zum Erstellen Von Virtuellen Umgebungen
- Wiederherstellung Verlorener Bilder: Schritt-Für-Schritt-Anleitung Zur Wiederherstellung Von Gelöschten Bildern Auf Verschiedenen Endgeräten
- Title: How Does EmEditor Handle Regex? Unveiling Its String Pattern Matching Skills
- Author: Brian
- Created at : 2024-11-24 16:24:20
- Updated at : 2024-11-30 23:29:21
- Link: https://win-net.techidaily.com/how-does-emeditor-handle-regex-unveiling-its-string-pattern-matching-skills/
- License: This work is licensed under CC BY-NC-SA 4.0.