Skip to content

Commit

Permalink
For \w, consider all including unicode characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Unihedro committed May 24, 2016
1 parent 5cfe876 commit 6e2c5e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/templating/StringHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ trait StringHelper { self: NumberHelper =>
// https://github.com/ornicar/lila/blob/master/modules/security/src/main/DataForm.scala#L34-L44
// Example: everyone says @ornicar is a pretty cool guy
// False example: Write to [email protected], @1
private val atUsernameRegex = """\B@(?>[a-zA-Z_-][\w-]{1,19})(?![\w-])""".r
private val atUsernameRegex = """\B@(?>[a-zA-Z_-][\w-]{1,19})(?U)(?![\w-])""".r

private val urlRegex = """(?i)\b((?:https?:https://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s<>]+|\(([^\s<>]+|(\([^\s<>]+\)))*\))+(?:\(([^\s<>]+|(\([^\s<>]+\)))*\)|[^\s`!\[\]{};:'".,<>?«»“”‘’]))""".r

Expand Down

0 comments on commit 6e2c5e2

Please sign in to comment.