Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?:(?:from|join)(?:\s|\()+((?:\w*\.\w*)+)(?:\s|\))+)
/
gi

Description

this extracts the table name in the from or join clause from SQL query

Submitted by vwei02 - 9 years ago