且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP - 在字符串中查找数字

更新时间:2022-04-21 22:31:38

对于第二个方案,您可以查找以10"开头的行,然后是something",然后是 9 个连续的空格.在空格之后是您需要捕获的内容.正则表达式是 ^10.+\s{9}(.*)

For the second one, you could look for a line that starts with "10", then "something" and then 9 consecutive spaces. After the spaces is what you need to capture. The regex is ^10.+\s{9}(.*)