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

FFIND /E"reg exp" : not case insensitive

Discussion in 'Support' started by Stephen Howe, Oct 31, 2008.

  1. Stephen Howe

    Joined:
    Jun 7, 2008
    Messages:
    121
    Likes Received:
    0
    Hi

    Using TCC 9.02.152 on XP Professional, SP3

    If I do

    FFIND /E"reg exp"

    I notice that it is case sensitive (I would have expected the reverse with /C switching on case sensitive)
    Now how do I make expression being searched for case insenstive?

    Thanks

    Stephen Howe
     
  2. dbartt

    Joined:
    May 29, 2008
    Messages:
    36
    Likes Received:
    0
    It's not easy to find but the syntax is /E"(?i)reg exp". See the help for
    regular expressions; item 7 - Extended Groups.

    Dennis
     
  3. BillMc

    BillMc Guest

    On Fri 31-Oct-08 2:08pm -0600, Stephen Howe wrote:

    .> Using TCC 9.02.152 on XP Professional, SP3
    .>
    .> If I do
    .>
    .> FFIND /E"reg exp"
    .>
    .> I notice that it is case sensitive (I would have expected
    .> the reverse with /C switching on case sensitive)
    .> Now how do I make expression being searched for case insenstive?

    Yes, I lost - more people wanted case sensitive, so you need
    a "(?i)" in front of everything for case insensitive -
    assuming perl regex.

    I deal with this with a small group of user-defined
    functions:

    ire=%@if[%@index[%1,^"] eq 0,%@insert[1,(?i),%1],%@insert[0,(?i),%1]]
    re=%@RegEx[%@ire[%1],%2$]
    rei=%@RegExIndex[%@ire[%1],%2$]
    res=%@RegExSub[%1,%@ire[%2],%3$]

    So for the example you gave, one would write:

    FFIND /E%@ire[regex]

    --
    Best regards,
    Bill
    4nt 8.02.106 / tcmd 9.02.152 cp 2.11.34 on xp pro sp3
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,860
    Likes Received:
    83
    WAD (and as documented) - the /C only affects /T, not /E.

    Rex Conn
    JP Software
     
  5. gwgaston

    gwgaston Senior IT Security Consultant

    Joined:
    May 28, 2008
    Messages:
    40
    Likes Received:
    1
    This limitation is the reason I still use findstr, grep, etc in most of my stuff. While this syntax works while in perl syntax, apparently SOL with GNU.
     

Share This Page