T-SQL 中的 SQL Server 正则表达式 [英] SQL Server Regular expressions in T-SQL

查看:45
本文介绍了T-SQL 中的 SQL Server 正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何用 T-SQL 编写的正则表达式库(没有 CLR,没有扩展的 SP,纯 T-SQL)用于 SQL Server,并且应该适用于共享主机?

Is there any regular expression library written in T-SQL (no CLR, no extended SP, pure T-SQL) for SQL Server, and that should work with shared hosting?

  • 谢谢,我知道 PATINDEXLIKExp_ sps 和 CLR 解决方案
  • 我也知道这不是正则表达式的最佳位置,问题是理论上的:)
  • 也接受减少的功能
  • Thanks, I know about PATINDEX, LIKE, xp_ sps and CLR solutions
  • I also know it is not the best place for regex, the question is theoretical :)
  • Reduced functionality is also accepted

推荐答案

PATINDEX 函数?

TSQL 中的模式匹配不是一个完整的正则表达式库,但它为您提供了基础知识.

The pattern matching in TSQL is not a complete regex library, but it gives you the basics.

(来自在线图书)

Wildcard  Meaning  
% Any string of zero or more characters.

_ Any single character.

[ ] Any single character within the specified range 
    (for example, [a-f]) or set (for example, [abcdef]).

[^] Any single character not within the specified range 
    (for example, [^a - f]) or set (for example, [^abcdef]).

这篇关于T-SQL 中的 SQL Server 正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆