I want to search for a specific pattern which contains a numeric "1" and replace it with the same string followed by the numeric "2". But if I call $12
then the output is the literal "$12". The regex engine seemingly tries to find the memory slot 12, but I intended to address the memory slot 1, and then write "2".
I tried to create a fiddle but this doesn't reproduce the error, so apparently it has something to do with my editor. I am using Dreamweaver CS6. If not with Dreamweaver then maybe my Dreamweaver settings.
Also, I just found this question which refers to my exact same problem – but the answer provided there doesn't work for me. $012
just writes "$012". I guess the Dreamweaver RegExp engine is peculiar like that.
Any ideas?
EDIT:
Given the example text …
This is item 1
This is house 3
… and the pattern ((?:item|house) )\d
what I tried | what I'm getting
$12 | $12
$012 | $012
\g{1}2 | \g{1}2
$g{1}2 | $g{1}2
$12 | item2 // or "house"
${1}2 | ${1}2
"$1"+2 | "item"+2
The desired result is always:
This is item 2
This is house 2
Because it was asked: yes, I am sure that the RegExp checkbox is activated and yes, I am sure that I'm in the Code view, not the Design view. I always work in Code view.
My Dreamweaver is CS6 Version 12.0 Build 5861.