[Implemented] caseless for CreateRegularExpression()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

[Implemented] caseless for CreateRegularExpression()

Post 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.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post by ts-soft »

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post by jassing »

Can't you just use (?i)?
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post 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.
"Have you tried turning it off and on again ?"
A little PureBasic review
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post by SFSxOI »

YES!!!!

I agree with luis, please add a #PB_RegularExpression_Caseless.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post 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
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: #PB_RegularExpression_Caseless for CreateRegularExpressi

Post 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?
Post Reply