Thread: Regex examples
View Single Post
Old 06-11-2013, 05:22 AM   #242
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by abeonis View Post
I didn´t know this one. I have twice this problem as I write in french and spanish (2x exotic characters) and want to use the same regex.
  • The fist method I used was the looooonnnnnngggggggg enumeration of all possible characters in both languages
  • Then I started using the interval [€-˙] that contains only the exotic characters and added it to other intervals
Your method is still more elegant
i also needed this periodically, good to have it brought up again.

a question for anyone who might know: my main tool is a text editor with a python regex interpreter. regular-expressions.info says that

"The only significant features missing from Python's regex syntax are atomic grouping, possessive quantifiers and Unicode properties."

am i right to understand that this pattern \p{L} falls under the category of unicode properties, and is not supported by python interpreters?

as an aside, i realize it's been mentioned in other threads, but it really would be great to have a forum for regex on MR, or a place to organize regex snippets to avoid having to look through this monster thread.
mzmm is offline   Reply With Quote