Hi, all. Before I get into my issue, let me give you my specs:
- OS: Windows 10 Professional, most recent build
- IDE: Rapid PHP 2016 Version 14.3 (14.3.0.187)
Ok, here's what I'm seeing. If I do a RegEx search/replace for the pattern \_(\W) with the string *\1 it doesn't use the captured group, but instead uses literal \1 instead. However, if I put any character between the asterisk and \1 it works as expected. For example:
- String to search: "TEST _ TEST"
- Replacement Regex: \_(\W)
- Replacement string: _\1
- Result: "TEST *\1TEST"
- String to search: "TEST _ TEST"
- Replacement Regex: \_(\W)
- Replacement string: _(\1
- Result: "TEST *( TEST" <-- Please note the space
I haven't tried other RegEx patterns, but I've tried other replacement strings, and the only way I can get the captured group to appear instead of \1 is to place a character between the * and \1, and this is not desireable. The only workaround I've been able to find is to just do a simple (non-RegEx) search for just the underscore and make my replacements by hand. With hundreds of underscores to wade through in my text, in dozens of files, that can get a little tedious.