Regular Expressions 101

Community Patterns

Extract Sql Columns from the given query

1

Regular Expression
ECMAScript (JavaScript)

/
(?:\s*(?=\w+\.|.*as\s+|distinct\s+|)(\*|\w+)(?=\s*(?=,|from)))
/
ig

Description

Tries to find the column names from the given SQL query.

Submitted by anonymous - 7 years ago