I am trying to replace '-' (hyphen) in the file name to '__' (underscore)in a specific regex pattern.
For example, changing /abc/123-def-xyzz.html to /abc/123_def_xyzz.html.
I tried to use the regex below to match the file name by separating the text with hyphen and the text with extension. It matches /123_def_.
\/((.[^/]*))-+(?=.*\.html)
However, I fail to replace hyphen to underscore in this pattern. Using $1_ will result in /123-def_xyzz.html.