Android | Syntax Error in regexp pattern

前端 未结 3 1591
猫巷女王i
猫巷女王i 2020-12-21 09:00

I am using \\\\.(.*)} regex pattern to search a specific string in my Android Test Project. when i am using this regex to check on online available tools the re

3条回答
  •  别那么骄傲
    2020-12-21 09:53

    You need to escape } as @Rohit Jain said:

    String regex = "\\.(.*)\\}";
    

    Your regex does work in java, but it fails on android for some reason.

提交回复
热议问题