XF 2.3 RegEx with flags

-Eric-

Member
Hi,

can't use Flags? (case insensitive)
/my_expression/gi
I am validating names (with accents).
Without using Flags, we will have to define range and individual letters in lowercase+uppercase in all groups.
 
Last edited:
He’s saying about accents, which presumably is in the expression somewhere (it isn’t in yours), and it was tripping up primarily on the g flag which isn’t necessary in PHP.
 
Yes, my post was to do with the delimiters and switches which is not actually explained anywhere, so it's not clear what the format is - the expression content can of course be changed to suit.

In custom user and thread fields for example, modifiers cannot be used and the start and end / must be omitted: ^[a-zA-Z0-9 _-]+$
 
I’d argue that’s a limitation because the flags should be available consistently everywhere - being able to toggle case insensitive can be super important (because writing out the regex for text otherwise can be a huge pain if you need to support non-ASCII text and the full Unicode character classes), and in some special cases I could see multi line being relevant if you’re doing something with backreference matching.
 
He’s saying about accents, which presumably is in the expression somewhere (it isn’t in yours), and it was tripping up primarily on the g flag which isn’t necessary in PHP.
No. The question is not about accents or expressions, just about the flag (we can't use).
I used uppercase+lowercase (expression size: 87 to 136).
 
Back
Top Bottom