普通EX pression从字符串中提取号码字符串、号码、普通、pression

由网友(爲何我還想他。)分享简介:有人可以帮我建立这种常规的前pression请... Can somebody help me construct this regular expression please...由于以下字符串... Given the following strings...在四月(123部件少456链轮)在五月(789部...

有人可以帮我建立这种常规的前pression请...

Can somebody help me construct this regular expression please...

由于以下字符串...

Given the following strings...

在四月(123部件少456链轮) 在五月(789部件少012链轮)

我需要一个正规的前pression会从文本中提取的两个数字。月份名称会有所不同。括号,部件少和链轮文本预计不会串之间转换,但是这将是,如果这段文字能变化,以及真正有用的。

I need a regular expression that will extract the two numbers from the text. The month name will vary. The brackets, "widgets less" and "sprockets" text is not expected to change between strings, however it would be really useful if this text was able to be varied as well.

在此先感谢。

推荐答案

如果你肯定知道,目前只有将是2个地方,你必须在你的数字字符串列表,这是你要的嘛拔出来,那么你应该能够简单地使用

if you know for sure that there are only going to be 2 places where you have a list of digits in your string and that is the only thing you are going to pull out then you should be able to simply use

d+
阅读全文

相关推荐

最新文章