Welcome!

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

SignUp Now!

FFIND /E"reg exp" : not case insensitive

Jun
121
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
 
> 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
 
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
 
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.
 

Similar threads

Back
Top