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

KahGanyshancy

New Member
I need a regular expression that matches UTF-8 letters and digits, the dash sign (\[code\]-\[/code\]) but doesn't match underscores (\[code\]_\[/code\]), I tried these silly attempts without success:
  • \[code\]([\w-^_])+\[/code\]
  • \[code\]([\w^_]-?)+\[/code\]
  • \[code\](\w[^_]-?)+\[/code\]
The \[code\]\w\[/code\] is shorthand for \[code\][A-Za-z0-9_]\[/code\], but it also matches UTF-8 chars if I have the \[code\]u\[/code\] modifier set.Can anyone help me out with this one?
 
Back
Top