Page 1 of 1
[Implemented] caseless for CreateRegularExpression()
Posted: Fri Aug 31, 2012 2:17 pm
by luis
Can you please add a #PB_RegularExpression_Caseless to CreateRegularExpression() flags ?
This would require passing PCRE_CASELESS to PCRE (I believe).
Would be handy when you don't care about case instead of to have to remember to put some modifiers inside every regex.
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Fri Aug 31, 2012 2:20 pm
by ts-soft
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Fri Aug 31, 2012 2:35 pm
by jassing
Can't you just use (?i)?
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Fri Aug 31, 2012 2:59 pm
by luis
jassing wrote:Can't you just use (?i)?
Yes ("
instead of to have to remember to put some modifiers inside every regex").
We could also just use (?s) for #PB_RegularExpression_DotAll, (?x) for #PB_RegularExpression_Extended, (?m) for #PB_RegularExpression_MultiLine, etc. but we have flags for those anyway.
Sometimes is convenient to have a global setting active and change it locally only IF and WHEN you need to do so.
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Sat Sep 01, 2012 12:15 am
by SFSxOI
YES!!!!
I agree with luis, please add a #PB_RegularExpression_Caseless.
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Sat Sep 01, 2012 7:55 am
by Little John
luis wrote:jassing wrote:Can't you just use (?i)?
Yes ("
instead of to have to remember to put some modifiers inside every regex").
The situation is even worse, because
(?i) does
not work correctly with special characters such as the German umlauts, see
http://www.purebasic.fr/english/viewtop ... 44#p383144
Regards, Little John
Re: #PB_RegularExpression_Caseless for CreateRegularExpressi
Posted: Sat Sep 01, 2012 8:07 am
by jassing
Yes ("instead of to have to remember to put some modifiers inside every regex").
Sorry for being dense -- but what is the difference if you have to add 3 characters to your string, or add a flag? Either way you have to remember to do something....
[...](?i) does not work correctly with special characters such as the German umlauts[...]
is this a problem with pcre itself, with PB's implementation of pcre, or the use of (?i) is reserved for only english characters?