我想创建一个计算器,其中操作数是单词。它可以重复任意次数。 例如EmpName + xyz或EmpName或x + rr + fff。 它应该拒绝这种模式,例如 EmpName +
我创建一个正则表达式:为计算器创建正则表达式模式
(?m)(?<Operand>^[a-z].*?)(?<Operator>[+*])
On this output:
1) a + b
2) ab+dddd
3) ab*fffff*ggggg
4) dfg+fg4444+fgf4
5) xxxxx
But it only targets 1,2,3,4 and up to only first operator. Output in regex 2.05.
"Operand: [ab]"
"Operator:[+]"
I am using regex builder 2.05 to test my regex. How i can repeat this pattern any number of times? Thanks in advance.
你是否需要覆盖括号? – aioobe
你在使用哪种语言? – aioobe
是的,我需要parantheses以及分,百分比,减号也。我正在使用.net –