如何在通配符中处理OR运算符? [英] How to handle OR operator in wildcard?

查看:120
本文介绍了如何在通配符中处理OR运算符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<([ivxlcdm]@)> for capture the small roman letters
		
		
i use this wild card for capture the oxidation terms 
like this[ i ,iii, iv, ix
]	
		all are in small case, i am trying to select both small case and uppercase in single wildcard it not worked whats the problem
		
		<([ivxlcdm]@|[IVXLCDM]@)> for capture both caps and small roman letters

推荐答案

别忘了你的ch aracter类表示一个罗马数字,而不是多个。此外,您可能希望在开头添加 ^
Don't forget that your character class indicates that there is one Roman numeral, not multiple. Also, you might want to add ^ and


结束以表示字符串开始/结束。

at the beginning/end to indicate that the string starts/ends.
^[ivxlcdm]+|[IVXLCDM]+




+ 表示:一个或多个。



如果你允许将小写和大写罗马数字混合在一起,将它们全部放在一个字符类中:


The + indicates: one or more.

If you allow that lowercase and uppercase Roman numerals are mixed, put them all in one character class:

^[ivxlcdmIVXLCDM]+


这篇关于如何在通配符中处理OR运算符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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