EmEditor (text editor) Forum Index
   Regular Expressions
     Example please for (?n:true_expression:false_expression)
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
Stefan
Posted on: 10/18/2011 10:12 am
Home away from home
Joined: 7/14/2008
From: Germany, EU
Posts: 259
Re: Example please for (?n:true_expression:false_expression)
Thank you.

My understanding right now:
You have to set up the FIND RegEx with an alternation so that it has both a success and a failure point.
As the REPLACE have too possibilities too: (?n:true_expression:false_expression)


Test:

I have:
Test Price 1000
Test Price 100
Test Price 800

Find: (.+) (.+) (\d{3})(\d)*
Repl: (?4:\0 too expensive:\0 affordable)
[X] Use RegEx

Result:
Test Price 1000 too expensive
Test Price 100 affordable
Test Price 800 affordable




Thanks again. I still have to do some test, but i think you showed me the way.



-
BTW, good idea of you:
Replace: \0 (?4:too expensive:affordable)
-
Flat Previous Topic | Next Topic


Subject Poster Date
   Example please for (?n:true_expression:false_expression) Stefan 10/13/2011 10:51 pm
     Re: Example please for (?n:true_expression:false_expression) JohnQSmith 10/17/2011 12:10 pm
       Re: Example please for (?n:true_expression:false_expression) Stefan 10/17/2011 9:46 pm
         Re: Example please for (?n:true_expression:false_expression) Stefan 10/17/2011 11:18 pm
           Re: Example please for (?n:true_expression:false_expression) JohnQSmith 10/18/2011 6:39 am
           » Re: Example please for (?n:true_expression:false_expression) Stefan 10/18/2011 10:12 am
               Re: Example please for (?n:true_expression:false_expression) JohnQSmith 10/18/2011 10:39 am

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