This question already has an answer here:
Learning Regular Expressions [closed]
(1 answer)
Closed 3 years ago.
My String is -> {{mike}} {{michael}} {{jordan}}
Give me result like this
group 1 -> mike
group 2 -> michael
group 3 -> jordan
In general you can go for this
\{\{(\w+)\}\}
It captures all the characters inside the double braces (without spaces, if you need space you can use [\w\s]* inside the braces)
Related
This question already has answers here:
Delete all content but keeping matched
(1 answer)
How do (*SKIP) or (*F) work on regex?
(2 answers)
Closed 5 months ago.
I'm trying to remove all characters except those sandwiched between 2 strings,
my original text:
BlahBlahBlahBlahBlahbeginningMY,IMPORTANT,text,1endblahblahblahblblah
XXXXXXXXXXXXXXXXXXXXbeginningMY,IMPORTANT,text,2endblahb2XXXXXXXXXXXX
YYYYYYYYYYYYYYYYYYYYbeginningMY,IMPORTANT,text,3endYYYYYYYYYYYY
UUUUUUUUUUUUUUUUUUUUbeginningMY,IMPORTANT,text,4endUVUVUVUVUVUVUVUVUV
The desire output:
beginningMY,IMPORTANT,text,1end
beginningMY,IMPORTANT,text,2end
beginningMY,IMPORTANT,text,3end
beginningMY,IMPORTANT,text,4end
I used this
beginning(.*)end
RegEx in regexr.com and got a useful list like this
I'm not allowed to upload my data to any website so how can I do this On Notepad++ ?
This question already has answers here:
Using explicitly numbered repetition instead of question mark, star and plus
(4 answers)
Closed 4 months ago.
This should match
1233232985 John Doe
This should not match
John Doe 47437363
What I have attempted.
^\d{10-12}
Maybe this will help
"^[0-9]{10}$|^[0-9]{12}$"
This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 2 years ago.
For example, I would like to find ty in:
erytypotym5ty
etytyty
koetymitywty
or il in:
keililmil
ilwrilltyil5ile
^.*(\w{2}).*\1.*\1.*$.
The two letters (also digits and _; you could replace \w with [a-zA-Z], if you don't want them) will be in group 1.
https://regex101.com/r/11Oq70/1
This question already has answers here:
A regex to match a substring that isn't followed by a certain other substring
(5 answers)
Closed 3 years ago.
How to mark xy if the next symbol is not y?
I have four strings:
1. zxyy
2. zxyz
3. zxy
4. xy
The epxression should mark strings 2-4.
This regex marks the 2-nd string only:
([x][y])(?=[^y])
Thanx.
The regex recommended by Aaron works as I wished:
xy(?!y)
It marks 2. zxyz 3. zxy 4. xy, but not 1. zxyy.
This question already has an answer here:
Learning Regular Expressions [closed]
(1 answer)
Closed 5 years ago.
I want regex with at least 2 characters start with any alphabet or any digit not matters.But It can accept - and _ .
Ex : ABD , Abc_123 , 12, A-_ , A1 etc.
(Updated)
(?=[-\w]{2}).*
Online test, https://regex101.com/r/JcUaBz/2
This should do the trick:
[\w-]{2,}
But, if you want to ignore words that have special characters, you can use this:
(?<=\s|^)([\w-]{2,})(?=\s+|$)