2

Hyphen, figure dash, en dash, em dash, horizontal bar and hyphen-minus: I want to have a regex expression to detect any one of these separators (character representing an horizontal central line).

Till now I got this:

/[\-\–\—\−\―]/

but I don't know if it is robust enough and btw, I wanted to have with the character codes, to avoid changing the character upon some copy-paste conversion.

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109

1 Answers1

2

Finally found:

[\u002D\u058A\u05BE\u2010\u2011\u2012\u2013\u2014\u2015\u2E3A\u2E3B\uFE58\uFE63\uFF0D]

Got the codes from here, but I just used, as stated in the question, the single horizontal lines

enter image description here

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109