Regular Expressions 101

Community Patterns

Find a select or select top in a query

1

Regular Expression
ECMAScript (JavaScript)

/
(select top [0-9]+ percent|select top [0-9]+|select )
/
ig

Description

Some times we need replace de first select in a query to another. In my case i want replace to "Select top 1". With that a can replace any select to select top 1.

Submitted by Diego Troitiño - 9 years ago