0

Find and Replace: named capture does not work in replacement section

Iterator 6 years ago 0

hello world! world!

this matches with following regexp in find

(?<aa>[^ ]+)\s+(?<bb>[^ ]+)\s\k<bb>


However when I replace this to \k<bb>, it prints out just k<bb> in plaintext, instead of world!

I first thought replace section does not handle regular expressions, but \1, \2 works well even in replacement section. It seems replacement section does not handle named captures.