使用php preg_match [duplicate]使用正则表达式提取一串数字和符号

This question already has an answer here:

what regular expression i must use if i want to extract "-i123213131345" from URL like this http://example.com/blabla-bla-i123213131345/blabla

</div>

Try -i[0-9]+ pattern.

Sample:

$str = 'http://example.com/blabla-bla-i123213131345/blabla';
$pattern = '/-i[0-9]+/';
preg_match($pattern, $str, $matches);
var_dump($matches);

Demo

Here's useful tool to play with regexes before you implement them. Also it helps a lot to learn Regex.