Regular Expressions 101

Extract Sql Columns from the given query

Open Workspace
  • JavaScript
  • Match
1

Regular Expression

/
(?:\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