Skip to content

Basic regular expressions implemented as native SQL functions.

Notifications You must be signed in to change notification settings

bobmeyers5/NativeSqlRegex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

NativeSqlRegex

Basic regular expression support implemented in native T-SQL. Useful for environments where CLR integration is not an option.

Warning: While convenient, these functions are not blazing fast. Expect a few hundred matches per second for simple patterns. Performance tips welcome.

Examples:

IF dbo.RegexIsMatch('234-567-8901', '\d+-\d+-d+') = 1 ...

SET @areaCode = dbo.RegexMatchGroup('234-567-8901', '(\d+)-\d+-d+', 1);

Supported constructs

  • Character escapes: **
  • Character classes: \s \d \w .
  • Anchors: not supported yet
  • Grouping: (subexpression)
  • Quantifiers: ? * + (exact and/or lazy quantifiers not supported yet)
  • Backreference: not supported yet
  • Alternation: not supported yet
  • Substitution: not supported yet

References

https://msdn.microsoft.com/en-us/library/az24scfc

About

Basic regular expressions implemented as native SQL functions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published