Copy link to clipboard
Copied
Hi,
I am doing a regex search:
//\s+([a-zA-Z])To find all lines that match this:
// test
// another test
...
I would like to change the first char to uppercase. I thought I could use the following in the replace:
// \U$1to instruct the $1 result to be upper case but this doesn't work in dreamweaver.
Is there a way of instructing the search and replace dialogue to alter the $ output?
Copy link to clipboard
Copied
I don't follow. Can you be more specific? Give us some examples of the target string you're searching for and what should replace it.
Copy link to clipboard
Copied
Indeed, the
\U$1instruction does not work in DW but as expected in Notepad++.
However (unless you want it to), the initial request you make includes the invisible characters before any first letter, which results in the removal of that character when replacing.
In addition, this query also includes characters that are already capitalized, which is not necessary in itself.
So, I would suggest replacing your query with
(\b[a-z](?!\s))And
\U$1If I find an alternative in DW, I will come back to this post, but often, I make the REGEX in Notepad++, even in Vim
Copy link to clipboard
Copied
// test
// another test
...
By @RigidCollision
Youps, sorry, when I saw my answer displayed, I understood that, in your question, the lines starting with / corresponded to your search fields, so, your initial query and your replacement expression are quite correct.
They should work, if not, DW acts as expected, switch to Notepad++.
Sorry again for the noise.
Copy link to clipboard
Copied
*DW doesn't act as expected
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more