我正在努力匹配产品的标题,直到他们的包装尺寸。
示例:
返回:
Scent
使用^0-9*对数字进行匹配不考虑名称,包括数字值。
我能用^0-9*和(g_l_l~*)组合吗?
发布于 2022-04-01 04:47:31
您可以使用以下regex模式:
^.*(?=\s+\d+\w*(?: \w+)?$)
这个正则表达式表示匹配:
^.* all content from the start
(?=\s+\d+\w*(?: \w+)?$) until hitting a number with optional trailing
word characters, followed by space and optional unit,
at the end of the inputhttps://stackoverflow.com/questions/71701894
复制相似问题