用于从biztalk业务流程中的字符串获取数据的正则表达式 [英] Regular expression to fetch data from string in biztalk orchestration

查看:104
本文介绍了用于从biztalk业务流程中的字符串获取数据的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我必须从biztalk编排中的以下字符串中取几行:



string:



hi ,

I have to fetch few line from the below string in biztalk orchestration :

string :

Message             : Microsoft.XLANGs.Core.XlangSoapException: An error occurred while processing the message, refer to the details section for more information 
Message ID: {qewewqeweA-wqeF-4wewqe7-eqewq-4qweqewqeqe}
Instance ID: {Bqweqweqw-qwewqe-ewqqeqwe-wqewqeqwewq-qweqwewqeqwewqewqewqewqE}

Error Description: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter PersonalMobile_CountryCode is larger than that allowed on the SQL Server. Maximum length allowed is 10, length found was 12.

Server stack trace: 
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)









预期输出:错误描述:Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException:字段/参数PersonalMobile_CountryCode的输入数据大于SQL Server上允许的输入数据。允许的最大长度为10,找到的长度为12.



我尝试过:







expected Output : Error Description: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The input data for the field/parameter PersonalMobile_CountryCode is larger than that allowed on the SQL Server. Maximum length allowed is 10, length found was 12.

What I have tried:

created two varibales : 
obRegularExp  of type : System.Text.RegularExpressions.Match

sNotification =System.String

obRegularExp = System.Text.RegularExpressions.Regex.Match(Ex.InnerException.Message,"Error Description:(.*)");
sNotification = obRegularExp.Value.Replace("Error Description:", "");

But i am not bale to fetch the data with this expression. 
Can anyone helpe me on this to get the expected data in a single line without new line character in it.

推荐答案

试试这个:

Try this:
^Error Description:.*?




如果您打算使用正则表达式,请获取 Expresso 的副本[ ^ ] - 它是免费的,它会检查,测试和生成正则表达式。


If you are going to use regular expressions, then get a copy of Expresso[^] - it's free, and it examines, tests, and generates Regular expressions.


这篇关于用于从biztalk业务流程中的字符串获取数据的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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