Search code examples
sqlregexssms-2014

Regular expression for an SQL query


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


Solution

  • 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]'