Regex required: It should match for following patterns

后端 未结 3 1975
遇见更好的自我
遇见更好的自我 2021-01-25 11:25

Valid:

  1. ((int)10)
  2. (int)10
  3. ((char)((x+y)&1))
  4. ((int *)1)

Invalid:

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-25 11:38

    Adding to aioobe's answer:

    Looks like you're trying to write an expression parser. As already said in the other answer it is not possible using a regex. You should consider using an expression parser such as JEP or write one yourself using javacc.

提交回复
热议问题