Regular Expressions 101

Community Patterns

MySQL Full-Text BOOLEAN mode

3

Regular Expression
PCRE (PHP <7.3)

/
^(?:[<>~+-]?\((?:(?:[<>~+-]?[\w][\w-]+[*]?|"[^"]+")(?:\s+(?:[<>~+-]?[\w][\w-]+[*]?|"[^"]+"))+)\)|[<>~+-]?[\w][\w-]+[*]?|"[^"]+")(?:\s+(?:[<>~+-]?\((?:(?:[<>~+-]?[\w][\w-]+[*]?|"[^"]+")(?:\s+(?:[<>~+-]?[\w][\w-]+[*]?|"[^"]+"))+)\)|[<>~+-]?[\w][\w-]+[*]?|"[^"]+"))*$
/

Description

Checks if an input string is compatible with the BOOLEAN mode of MySQL full text search system

Submitted by greezybacon - 8 years ago