01-08-2019 02:29 PM
I have a string "hello" and "hellollo", and I want to find out either "llo" pattern or "llollo" pattern. But the regular express of (llo)+ doesn't work for me.
Many thanks!
01-08-2019 02:32 PM
01-08-2019 02:57 PM - edited 01-08-2019 03:08 PM
Match pattern uses a limited set of regular expressions terms. Try Match Regular Expression
EndigitBryan, the bracket will not match a pattern, but any of the letters in the set
e.g. 'l' in help, or 'oo' in hook
01-08-2019 03:35 PM
@Mancho00 wrote:
EndigitBryan, the bracket will not match a pattern, but any of the letters in the set
e.g. 'l' in help, or 'oo' in hook
You are right! I should have thought about it longer.
01-09-2019 03:26 AM
Of course "(llo)+" will also match "llollollo", "llollollollo", etc...
If you want to match only "llo" and "llollo", you'll need:
"(llo)|(llollo)", "(llo)()|(llo)", "(llo)(llo)?", "(llo){1,2}" or "(llo)\1?".