Link to home
Start Free TrialLog in
Avatar of Christopher Schene
Christopher ScheneFlag for United States of America

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
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try

^.*\b(risk)\b.*$

Open in new window

Regards
Avatar of Christopher Schene

ASKER

^.*\b(risk)\b.*$

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.*$
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
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works great!
^.*\b[Rr][Ii][Ss][Kk]\b.*$