- AuthorPosts
- May 5, 2015 at 2:21 am #20057Paul99Participant
Hi guys,
I’m wondering if it is possible to do a find and replace with a wildcard, e.g. replace john* with tim
I tried it but it doesn’t seem to recognise the *
Cheers,
Paul
May 5, 2015 at 10:04 am #20058StefanParticipantHi Paul,
please try Regular Expression, like
Find: john.+?\b
Replace: tim
[X] Regular ExpressionExplanation:
. (dot) >> match an single sign
+ >> match one-or-more of the expression just before (here: the dot)
? >> here: match non-greedy (only as much as need) . (depends which editor and which settings you use)
\b >> match till an space is foundMay 10, 2015 at 9:22 pm #20066Paul99ParticipantHi Stefan,
This is working well, I have had a look at the regular expression syntax so I can see all the settings now,
I am trying to match any term that contains (anywhere in the line) “.com”,
so I have
\.com.+
This finds all the .com’s but I want it to select what is before the .com also, for example “hello.com” I want to look for .com then select select the whole hello.com not just .com.
Best regards,
Paul
May 10, 2015 at 11:00 pm #20067StefanParticipantThe solution depends on how your real world example off “hello.com” look like.
For just “hello.com” search for \w+\.com
Find: \w+\.com
[X] Regular Expression
Explanation:
\w+ >> one-or-more (+) of “Any word character” (\w)
\. >> literal dot
com >> literal ‘com’
Even just “\w+.com” will work, but can lead to unwanted results as we search for one any-sign (.) instead of a real literal dot (\.)
More at the help > EmEditor Home – EmEditor Help – How to – Search >>> Regular Expression Syntax - AuthorPosts
- You must be logged in to reply to this topic.