Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

regular expression -- caseless

Oct
356
2
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
 
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
 
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
 
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.
 

Similar threads

Back
Top