字符串中的正则表达式搜索 [英] Regular expression search in String
本文介绍了字符串中的正则表达式搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
我有一个字符串列表(CString数据类型).这些实际上是文件名.从这些中,如何选择与正则表达式匹配的字符串?
例如:-如果搜索模式=.",我必须选择列表中的所有字符串.如果搜索模式为"ss",则必须选择其中包含"ss"的字符串.
更具体地说,我的列表是一组文件名.
Hi.
i have a list of strings (CString data type) with me. These are actually file names. From these, how can i select the strings which match a regular expression?
For eg:- if Search pattern = ".", i have to select all strings of the list. if search pattern in "ss", i have to select the strings having "ss" in it.
To be more specific, the list i have is a set of file names.
推荐答案
CString
不支持正则表达式.
您可以使用Boost::Regex
.
CString
does not support regular expressions.
You could useBoost::Regex
.
这篇关于字符串中的正则表达式搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文