Regex for string between a digit and character?

问题内容:

I have a few different strings that look like this:

aaaa01b.site.com
bbbb01ccc.site.com
cccc02dd.site.com
dd03eeee.site.com

All I am interested in is the characters between the last numeric digit and the first full stop, ie

b
ccc
dd
eeee

Is there a regular expression that can achieve this?

问题评论:

答案:

答案1:

Try this pattern:

.*\d+([^.]+)\.

The characters you want should be available in the first capture group.

Demo

答案评论:

原文地址:

https://stackoverflow.com/questions/47752063/regex-for-string-between-a-digit-and-character

Tags:

添加评论

友情链接:蝴蝶教程