Skip to content

匹配表情的正则有问题 #10

Description

@xuning0

目前的正则是\[.+?\],因为.会匹配任意字符,所以对于字符串xxx[[大笑]xx,会匹配到最外层的[[大笑],而非[大笑]。另外,这个?也多余。
正确的应该对于中括号内只匹配字母和汉字,\[[\u4e00-\u9fa5A-Za-z]+\]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions