从字符串中查找具有数字的特定单词


Find Specifc word with number from a string

我想从字符串中获得一个带数字的特定单词,例如

ABC312 is the string I want to filter...

ABC 312 is the string I want to filter...

从上面的字符串我想得到后面跟着"312"的"ABC"(在上面的字符串中,ABC将始终保持不变,它可以是不区分大小写的,但数字会改变…)它可以是ABC143、ABC001、ABC311、ABC145等。

preg_match( '/ABC's*[0-9]+/' );