Regular Expressions 101

Community Patterns

Extract name of tables from a SQL

1

Regular Expression
PCRE (PHP <7.3)

/
(?:FROM|JOIN)\s*(IDP_PRD_.+?)(?:\s|\))
/
g

Description

Assumes the database name starts with "IDP_PRD_"

Submitted by Vance - 8 years ago