Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 将正则表达式与SQL Server BIDS一起使用_Sql Server_Regex_Report_Bids - Fatal编程技术网

Sql server 将正则表达式与SQL Server BIDS一起使用

Sql server 将正则表达式与SQL Server BIDS一起使用,sql-server,regex,report,bids,Sql Server,Regex,Report,Bids,我正在使用SQLServer BIDS(BusinessIntelligenceDevelopmentStudio,VS2008)编写一份报告,我需要从字段值中删除标点符号 例如,如果字段值为“Hello,World!”,我希望报告将该值显示为“Hello World”。我知道,在本例中,使用Replace函数很容易,嵌套: =Replace(Replace(Fields!Description.Value,",",""),"!","") 但如果我必须删除的不仅仅是“,”和“!”字符,那么这很

我正在使用SQLServer BIDS(BusinessIntelligenceDevelopmentStudio,VS2008)编写一份报告,我需要从字段值中删除标点符号

例如,如果字段值为“Hello,World!”,我希望报告将该值显示为“Hello World”。我知道,在本例中,使用Replace函数很容易,嵌套:

=Replace(Replace(Fields!Description.Value,",",""),"!","")
但如果我必须删除的不仅仅是“,”和“!”字符,那么这很快就会变得“丑陋”。因此,简言之:

我可以使用正则表达式格式化SQL Server BIDS报告中的字段值吗

如果答案是“不”,那很好,这样我就不用浪费时间去找了!谢谢

更新

表达式公式中正则表达式的用法(尽管此表达式用于电话号码):


在客户端处理大量行可能需要一些时间。所以我建议在服务器端移动Regex逻辑

您可以为此使用CLR函数

请在此处查找示例:

更新

如果要在客户端进行处理,请查看在报告中使用表达式(包括正则表达式):

虽然这听起来是个不错的建议,但在本例中,我没有足够的权限访问服务器以更改提供的数据。我使用FetchXML语句来检索数据,任何处理都必须在报表(客户端)中进行。
=System.Text.RegularExpressions.Regex.Replace(Fields!Phone.Value, "(\d{3})[ -.]*(\d{3})[ -.]*(\d{4})", "($1) $2-$3")