s/(\w)-(\w)/\1 \2/g has two parts, the first part /(\w)-(\w)/ is the regexp, and the second part /\1 \2/ is just the same as any double quoted string so you have to use $1 and $2 here instead of \1 and \2.
In reply to Re: Regex backreferences
by jwkrahn
in thread Regex backreferences
by Mad_Mac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |