Community
Loading...
Posted inSQL
Microsoft
18 years ago

Regex functionality in pattern matching

It would be good to be able to have full regex capabilities when using LIKE or Patindex.
Under Review
ProgrammabilitySuggestions
Company Response
Microsoft
Company Response
Up: 419<=-=Mar 8 2007 3:20AM=-=>I agree with the functionality request, but not the suggested approach of enhancing the LIKE, PATINDEX or adding a table function.This functionality should be implemented by supporting the SQL99 SIMILAR predicate (ISO 9075 feature T141, ISO 9075-2-1999 section 8.6).<=-=Mar 21 2007 1:23PM=-=>I echo the wish to not overload LIKE or PATINDEX. Personally I don�t like SIMILAR either, though. How about a REGEX function with REGEX somewhere in the name?<=-=Aug 20 2007 10:21PM=-=>Hello,First of all i would like to thank all of you for sending your feedback to us. We are definitely going to consider adding this capability in the query language in a future release. However, until then have you considered using CLR integration for this purpose. .NET has the capability and it is very simple to use .NET to add this capability by adding a user-defined function that does this. The blog entry https://blogs.msdn.com/sqlclr/archive/2005/06/29/regex.aspx has sample code and discusses the available options via .NET.Thanks,Vineet RaoProgram ManagerMicrosoft SQL Server<=-=Aug 24 2007 6:21AM=-=>Every time customers ask for RegEx in SQL, MS employees seem consistent in their answers: go .NET CLRHowever, .NET CLR is disabled by default and there are environments where it doesn�t get enabled, period. It�s in those environments we need the power of RegEx directly in SQL Server.<=-=Dec 27 2007 4:42PM=-=>The CLR integration is not very friendly to ad hoc use of regular expressions. Both find and replace operators in SQL that take regular expressions would be very useful (preferably with a regex syntax identical to that used by .NET).Another advantage is that regular expressions can probably can be more efficiently accomplished as part of the SQL engine than in SQL, since the SQL engine could compile the regex prior to execution of the query.CLR does have regex compilation, but if I recall correctly, a compiled expression is never discarded fr..

0 Comments

You must to comment