Can I mix character classes in Python RegEx?

后端 未结 4 423
长情又很酷
长情又很酷 2021-01-12 19:04

Special sequences (character classes) in Python RegEx are escapes like \\w or \\d that matches a set of characters.

In my case, I need to b

4条回答
  •  情歌与酒
    2021-01-12 19:16

    You can use r"[^\W\d]", ie. invert the union of non-alphanumerics and numbers.

提交回复
热议问题