Regular expression for an SQL query

Harikrishnan N picture Harikrishnan N · Mar 22, 2017 · Viewed 9.3k times · Source

I'm looking for a regular expression for the below SQL query.

Select * from data where url like '%?%<alphabet>'

Where the

alphabet

can be any alphabet(a-z).

Thanks in advance

Answer

Cyndi Baker picture Cyndi Baker · Mar 22, 2017

While RegEx is not supported in SQL Server you may try using the pattern matching feature of the LIKE keyword.

Pattern matching in search conditions

SELECT * FROM data WHERE url LIKE '%[a-z]'