regular expression -- caseless

Oct 18, 2008
273
1
#1
Hello -- Is there a way to specify in a regular expression template
that the match is case neutral?

with grep there is the -i switch and PCRE does allow switches to be
specified with the template. My goal is to match

foo

in a string -- I don't case how its cased
 
#2
On Wed, 10 Aug 2011 00:53:49 -0400, fpefpe <> wrote:

|Hello -- Is there a way to specify in a regular expression template
|that the match is case neutral?

That depends on the regex syntax you've chosen (OPTION). With the PERL syntax,

Code:
v:\> echo %@regex[(?i)foo,FOO]
1

v:\> echo %@regex[foo,FOO]
0
 
Oct 18, 2008
273
1
#3
On Wed, 10 Aug 2011 00:53:49 -0400, fpefpe <> wrote:

|Hello -- Is there a way to specify in a regular expression template
|that the match is case neutral?

That depends on the regex syntax you've chosen (OPTION). With the PERL syntax,

Code:
v:\> echo %@regex[(?i)foo,FOO]
1

v:\> echo %@regex[foo,FOO]
0

Thanks -- That is the way the PCRE api works too

Frank
 

ron

Aug 19, 2008
146
0
#4
On Wed, 10 Aug 2011 00:53:49 -0400, fpefpe <> wrote:

That depends on the regex syntax you've chosen (OPTION). With the PERL syntax,

Code:
v:\> echo %@regex[(?i)foo,FOO]
1

v:\> echo %@regex[foo,FOO]
0
Thanks for that tip, something I was looking for and works nicely. But, Is that PERL? Looks like Onigmo.