regex string \b[nl]+[\W_]{0,3}[!i\/?1\\]+[\W_]{0,3}[qgb]+[\W_]{0,3}[qgb]?[\W_]{0,3}(?:[e3][\W_]{0,3}r|a)(?!ia|al)s*\b Test strings (matching) nigga n.i.g.g.a n.i.g.g.e.r n i g g a Fuck NIGGERS LIGGER l\igger!! n\gger n/gger niqqa nibba n1gger N!gger! nigge_r L I B E R A L non matching strings LiviusMagnus liberll liberalism linger lifebringer lighsaber living alone nibbler nibbla nibble nigburgers nicaragua Night Nigeria Ligume Legislation My leg! Nice work, Gary! Tonight Light lighter liberal Danzig Konnigsberg Jigger Pepperoni Germs Uppity Nig Trey Lorezno says, "Can.I g-ger a soda?"