I am using ctrl+shift+f to trigger "Find and replace", going to the tab "Replace in files".
I do a regexp search in the entire solution (which contains around 11000 files) for:
#layout(\d+)-top
replacing that with
#layout$1 .layout-top
A lot of files are changed by the operation, but when I after the operation open a certain css file, I still can read lines like:
#layout5-top,
#layout6-top
{
width: 960px;
height: 104px;
margin: 0 auto;
}
Why?
If I do the same search & replace with that file open, the operation will affect the file.
I can find numerous files that are not changed by the way.
In the progress indicator that comes up when the search and replace runs, I see that every file is processed, not just open files.
I hit exactly the same problem. It only seems to happen when using a regular expression. I know that the files are being matched because if I swap to just 'find in files', the correct lines are matched in the files. It seems to be a bug to me. Possibly, Microsoft don't trust us not to shoot ourselves in the foot with regexes. ;)
The only way I could resolve it was to select the option:
Replace All will open all files with changes for editing
If you don't get this warning dialog, you may have disabled it, see here.
Then just type ALTfl to save all files and close all. This seemed to work when there were around 200 files with replacements (the full set of files searched was around 10000). I am not sure how many files Visual Studio can have open at one time, so I imagine at some point it will no longer work or replacements will be missed, in which case you may need to run it a number of times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With