I'm trying to find and then replace instances of hyphens with en and em widths.
So, in the example: "10-100" the hyphen would be replaced by an en width. Also, in the example: "It is - without doubt - the worst" or: "It is -- without doubt -- the worst" either instances would be replaced by an em width.
However, I just can't figure out the proper pattern for preg_replace() in PHP.
"/[0-9]+(\-)[0-9]+/"
... appears to do the replace, but removes the numbers.
How do I get preg_replace() to ignore the patterns either side of the subject?