RegEx: \w - “_” + “-” in UTF-8

前端 未结 2 796
星月不相逢
星月不相逢 2020-12-14 11:36

I need a regular expression that matches UTF-8 letters and digits, the dash sign (-) but doesn\'t match underscores (_), I tried these silly attemp

2条回答
  •  别那么骄傲
    2020-12-14 12:03

    I am not sure which language you use, but in PERL you can simply write: [[:alnum:]-]+ when the correct locale is set.

提交回复
热议问题