Quote:
Originally Posted by 1v4n0
If I put the regex between (brackets) it saves the value it finds, which then I can paste by writing \1 in the "replace" field.
|
That isn't "brackets" it is "parenthesis."
Quote:
Originally Posted by 1v4n0
EDIT: Issue had already been solved, here.
|
Also, great job with the edit. So often you see others say something along the lines of "found the answer," and they never post the solution! So when others stumble upon this topic, they have no clue!
If you are just starting out with Regex, I would recommend looking through the Sticky Regex topic here for lots of examples:
https://www.mobileread.com/forums/sho...d.php?t=167971
Anyway, this one is as easy as pie. What I would typically do is this:
Search: -([0-9])
Replace: - \1
May I ask exactly what the use case is for adding a space between a dash and a number?
The only thing I can think of with dashes and numbers is swapping hyphen -> en dash.... although maybe my mind is just too far up proper typography field.
For example, I use this one all the time:
Search: ([0-9])-([0-9])
Replace: \1–\2
So what this does is replaces "number" + "hyphen" + "number" with "number" + "en dash" + "number".
This is the typographically correct way when dealing with years, or page numbers:
1910–1930
pp. 320–325