For over a year I have been trying to do the simplest thing - do an HTLM/PHP search and replace in several files.
For exapmle if I want to replace
<!DOCTYPE html>
with
<!DOCTYPE html>
<!--
TODO UNIVERSAL
Favicon
Page title
Active page
-->
I get
<!DOCTYPE html> <!-- TODO UNIVERSAL Favicon Page title Active page -->
I realize search and replace is probably considered old fashioned but I have found it an incredibly useful tool for 30 years.
I have scoured JetBrains web site with no avail and searched here and elsewhere.
I have tried /n, \n, \\n, \\n\\r etc etc and nothing seems to work.
I am sure I am being a dunce but could some other PhpStorm user please enlighten me.
Search for:
\<\!DOCTYPE HTML\>
Replace with:
\<\!DOCTYPE html\>\n\<\!\-\-\nTODO UNIVERSAL\nFavicon\nPage title\nActive page\n\-\-\>
Make sure that Regex option is checked
(here on screenshot you see the result of such replacement)
P.S.
PhpStorm (and other IDEA-based IDEs) uses \n
internally (while editing) for all line endings. And then, when saving, it uses detected/proper line ending.
This can be achieved with simple and tiny application geany
.
I don't know on which platform you are, but it's available on Ubuntu and Windows both.
- You can open all files in whclich you want to search and replace.
- Open replace dialog
- Enter text in
find
and replace
text box.
- Here make sure one thing that you copy and paste "replace" text with new line character from a file opened in geany. New line character will be converted to some non readable character, but don't worry just replace it will be as new line after replace.