查找单词的正则表达式以两个连续的$符号开头 [英] regex expression for find words starts with two consecutive $ sign

查看:136
本文介绍了查找单词的正则表达式以两个连续的$符号开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从句子中取出以$符号开头的单词。为此,我写了

Regex.Matches(正文,(\\ $ \\\\ + +))。



但是我目前的要求是获取以两个连续$符号开头的单词。



例如:

句子:-my名字是$$ shibashish,年龄是二十美元。



结果应该是:shibashish和二十。



请帮助我,这很紧急。



提前谢谢。

I am fetching words which starts with $ sign from a sentence. for this I have written as
Regex.Matches(body, "(\\$\\w+) ").

But my current requirement is to fetch words which starts with two consecutive $ sign.

for an example:
sentence:-my name is $$shibashish and age is $$twenty.

result should be : shibashish and twenty.

please help me it's urgent.

Thanks in advance.

推荐答案

从一个句子签名。为此,我写了

Regex.Matches(正文,(\\
sign from a sentence. for this I have written as
Regex.Matches(body, "(\\


\\\\ + +))。



但是我目前的要求是获取以连续两个
\\w+) ").

But my current requirement is to fetch words which starts with two consecutive


符号开头的单词。



的例子:

句子:-my name is
sign.

for an example:
sentence:-my name is


这篇关于查找单词的正则表达式以两个连续的$符号开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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