开发者

It return false instead of true

How to match "FileNew" in "FileNewABC" which is a value from f_var and return true?

newfilename = Patte开发者_运维百科rn.compile("FileNew").matcher(f_var).matches();

It always return false.


You need to use find or it will try and match entire input to the pattern.

  • The matches method attempts to match the entire input sequence against the pattern.

  • The lookingAt method attempts to match the input sequence, starting at the beginning, against the pattern.

  • The find method scans the input sequence looking for the next subsequence that matches the pattern.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜