开发者

regex for number between two underscores

开发者 https://www.devze.com 2023-02-25 11:19 出处:网络
I开发者_开发百科 am trying to find the number between two underscores (_) in this string 234534_45_92374

I开发者_开发百科 am trying to find the number between two underscores (_) in this string

234534_45_92374
3433_9458_034857
zx_8458_047346daf

what would be the regex for this?


preg_match('/_(\d+)_/', $str, $matches);
$number = (int) $matches[1];
0

精彩评论

暂无评论...
验证码 换一张
取 消