正则表达式:匹配两个或多个前面的标记?

Ror*_*ach -1 regex

我有兴趣看看是否可以创建这样的正则表达式?例如,这个正则表达式将恰好匹配前面的两个标记:^((pi|e|x|([-]?[0-9]*[.]?[0-9]+)){2}),并且只要它里面有两个或多个内容,我就想匹配这样的字符串。

//want to recognize
//piex14.3   -- will see pi, e, x, number of type double
//14e        -- will see number of type double, e
//12.5pi     -- will see number of type double, pi
//ex         -- will see e, x
Run Code Online (Sandbox Code Playgroud)

R S*_*ahu 5

来自https://en.wikipedia.org/wiki/Regular_expression

{min,} 前一项匹配最少或多次。

你应该能够使用^((pi|e|x|([-]?[0-9]*[.]?[0-9]+)){2,})