I have a string called 'raw'. I am trying to parse it in ruby in the following way:
raw = "HbA1C ranging 8.0—10.0%"
raw.scan /\d*\.?\d+[ ]*(-+|\342\200\224)[ ]*\d*\.?\d+/
The output from the above is []
. I think it should be: ["8.0—10.0"]
.
Does anyone have any insight into what is wrong with the above regex statement?
Note: \342\200\224
is equal to —
(em-dash, U+2014).
The piece that is not working is:
(-+|\342\200\224)
I think it should be equivalent to saying, match on 1 or more -
OR match on the string \342\200\224
.
Any help would be greatly appreciated it!