且构网

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

正则表达式适用于在线测试程序但在java中失败

更新时间:2023-02-18 21:22:14

您需要致电 find 移至第一场比赛。在调用 group()之前添加 matcher.find();

You need to call find to move to the first match. Add matcher.find(); before calling group().

一旦你这样做,你的代码就会按预期工作。

Once you do that your code works as expected.