Forum Discussion

PSCramer's avatar
PSCramer
Copper Contributor
Jun 25, 2023

Replacing Hyphens with En Dashes

Hi everyone,

 

I am editing a 90,000 word document that frequently references numbered ranges using hyphens, but for style reasons, I need to update to use en dashes. 

E.g., 53:3-5, 1:10-12, 37:2-4, etc.

 

When I use the following commands with the Find and Replace function, I receive the error "That replacement text contains a group number that's out of range."

 

Find what: [0-9]-[0-9]

Use Wildcards

 

Replace with: \1^=\2

(where ^= is intended as the en dash and the \1 and \2 to keep the same numbers)

 

Does anyone have other suggestions or ideas what is causing the error?

 

Thank you!

Resources