Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am looking to create a single regex statement that is generally case insensitive, but, within the statement, demands a certain case. For example, I want to match a general pattern like this:
A) Title of paragraph
But dont want to match this:
a) Title of paragraph
The trouble is, the "title of paragraph" portion needs to be case insensitive, so, I want the statement to also match this
A) TiTLE of PARagraPh
but not this:
a) TiTLE of PARagraPh
Is there any way to accomplish this in a single regex statement? If I turn the "i" pattern modifier on, is there any way to turn it off for a small portion of the regular expression (the "A)") portion? Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Selective Case sensitivity
by toolic (Bishop) on Feb 18, 2012 at 19:59 UTC | |
|
Re: Selective Case sensitivity
by davido (Cardinal) on Feb 18, 2012 at 19:59 UTC | |
|
Re: Selective Case sensitivity
by LonelyPilgrim (Beadle) on Feb 18, 2012 at 19:57 UTC |