Community Patterns

Community Library Entry

2

Regular Expression
Created·2024-10-08 14:01
Flavor·PCRE2 (PHP)

/
^(?:(?!(?:not allowed|filter|mirc)).)*?(?:http:\/\/|www\.|porn|credit card)(?:(?!(?:not allowed|filter|mirc)).)*$
/
gim
Open regex in editor

Description

Match a string that contains any of the following substrings: http://, www., porn, or credit card. But don't match the text if it contains one of: not allowed, filter, or mirc.

Don't use word boundaries (anywhere in the text is fine).

If you need help, try reading this.

Submitted by anonymous