我正在尝试匹配此模式:
] 1 some words 2 some other words 3 some other words
但如果是以下情况,则不匹配:
] 1 some words 2 some other words 3 T
或
] 1 some words 2 some other words 3 some other words 4 words 5 words
例如,我想匹配以下内容:
e fare … incontro] 1 p 2 perchè dopo quell 3 e
这是我的尝试,但无法正常工作:
\]\s*1\s*([\w\s]+)\s*2\s*([\w\s]+)\s*3\s*([\w\s][^\W\d_T]+)
规则: -如果有“3 T”,则根本不匹配 -如果在“3”之后有4或5,则根本不匹配
从你的正则表达式,我想我明白你在尝试什么。我猜你很接近:
在您的模式中,更改:
到
并添加到开头
Regex Demo
相关问题 更多 >
编程相关推荐