Christopher Schene
asked on
Need case insensitive Regex that excludes all lines with the word risk in them
Need case insensitive Regex that excludes (does not match) all lines with the word risk in them
ASKER
^.*\b(risk)\b.*$
Works for lower case
this line says lower case risk
but not upper case
this line says lower case RISK
Works for lower case
this line says lower case risk
but not upper case
this line says lower case RISK
How do you use the regex?
Ignore case is generally an option
or
^.*\b(risk|RISK)\b.*$
Ignore case is generally an option
or
^.*\b(risk|RISK)\b.*$
ASKER
I think you need all possible combinations,
^.*\b(risk|RISK|Risk|RIsk| RISk|rISK| riSK|risK) \b.*$
This is part of a pager system at work and we don't have an option to specify case insensitivity
^.*\b(risk|RISK|Risk|RIsk|
This is part of a pager system at work and we don't have an option to specify case insensitivity
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works great!
^.*\b[Rr][Ii][Ss][Kk]\b.*$
pls try
Open in new window
Regards