How to match “any character” in regular expression?

前端 未结 11 672
忘了有多久
忘了有多久 2020-11-27 09:23

The following should be matched:

AAA123
ABCDEFGH123
XXXX123

can I do: \".*123\" ?

11条回答
  •  醉话见心
    2020-11-27 10:21

    No, * will match zero-or-more characters. You should use +, which matches one-or-more instead.

    This expression might work better for you: [A-Z]+123

提交回复
热议问题