FFIND /E"reg exp" : not case insensitive

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 7, 2008
121
0
#1
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
 
May 29, 2008
36
0
#2
> 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?
>
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
 
B

BillMc

Guest
#3
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
 

gwgaston

Senior IT Security Consultant
May 28, 2008
40
1
SC
#5
On Fri 31-Oct-08 2:08pm -0600, Stephen Howe wrote:
a "(?i)" in front of everything for case insensitive -
assuming perl regex.
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.