Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
\s(?:from|join)\s*(\[?[\S]+)\]?(?:\s?)(?:(?:as)?\s?)(?!(join|where|from|left|right|outer|inner|on))(\w*)
/
ig

Description

Searches simple Select-From-Where style queries for tables and their aliases (if they have any). Doesn't properly handle subqueries used in place of tables!

Submitted by Tsaukpaetra - 8 years ago