1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

regular expression -- caseless

Discussion in 'Support' started by fpefpe, Aug 10, 2011.

  1. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    241
    Likes Received:
    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. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,877
    Likes Received:
    30
    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
     
  3. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    241
    Likes Received:
    1

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

    Frank
     

Share This Page