正则表达式匹配字符串 [英] Regular expression to match string

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

问题描述

大家好,

请帮我找到正则表达式:

我的价值如下:''Martin Lucas''

和我的输入字符串是:''我的名字是Martin Lucas,我​​和ABC先生一起工作'。

现在我必须匹配是否名称''Martin Lucas''存在于给定的字符串中。

请建议正则表达式

解决方案

你不需要regexp。字符串我的名字是Martin Lucas,我​​和ABC先生一起工作包含字符串 Martin Lucas 。使用 String.Contains [ ^ ]!


你能看看下面给出的链接吗? :



Link [ ^

Hi all,
Please help me to find regex:
I have value like: ''Martin Lucas''
and my input string is : ''My name is Martin Lucas, i am working with Mr ABC''.
now i have to match whether the name ''Martin Lucas'' is exist in given string.
please suggest the regular expression

解决方案

You don''t need regexp for that. The string My name is Martin Lucas, i am working with Mr ABC contains the string Martin Lucas. Use String.Contains[^]!


Can you have a look at the link given below:

Link[^]


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

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