Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Visual Studio 2013 - Replace All bugged (Visual Studio 2013 bug)

$
0
0

Visual Studio 2013 "Replace All" is apparently bugged for Regular Expressions.

SHORT VERSION:

Under some conditions, using Regular Expressions, "Replace All" finds no matches; however "Find Next" works.

LONG VERSION:

I am attempting to perform a "Replace All" in all *.foo files in directory Zot and its subdirectories (names made up, but illustrate the issue).

The "Look In" field refers to a folder set containing the single directory, "Zot".

I am using Regular Expressions.

Upon attempting a "Replace All" operation, 0 matches are found, with 41 files searched.

Actually, matches should be found in every one of those files.

When I click "Find Next", the "first file" is opened, and a match IS found.

I can click "Replace", and continue to perform "Find Next"/"Replace" actions, and Visual Studio will iterate through each file, and each match within the file.

Of course, each modified file remains open in the editor.

If I open any of these files, and select "Current Document" for "Look In", then "Replace All" works fine.


Below is a link regarding a related (identical?) problem.

It is unclear, for the below link, what the scope of "Look In" was.

The issue was for Visual Studio 2012.

Microsoft reported it as being repeatable, and brought to the attention of the engineering department.

Either they didn't get to it, or didn't get the fix completely right.

The bug apparently "migrated" into VS 2013.

I consider this a substantial problem.

There have been occassions on which I've wanted to update a lot more than 41 files.

Even for my current issue, I'd have to click "Find Next/Replace" several hundred times, and deal with saving the files. For a "single" text replacement. And I have more than one. I don't wish to perform thousands of clicks to get this done.

I'll probably find an alternative means, such as look for a "sed" or other utility, or write a quick and dirty one.

ODDITY:

I attempted the "Replace All" operation several times.

At some point, matches were found in ONE of the 41 files.

Further, this change is repeatable.

I should mention that the text change is such that the replacement text matches the "find" regular expression (i.e., if the "Replace All" operation were performed repeatedly on a single document, each such operation after the first would result in various texts being replaced by "themselves").

[For example, replacing "Badda.*Bang" with "BaddaBingBang" repeatedly.]

Now, when I perform a "Replace All", the same 4 "occurances" in that file are found and replaced (but Visual Studio still fails to find matches in the other 40 files).

[A minor advantage of a quick and dirty utility: it could be written to not write (update) a file if the net effect of all replacments for the file is "no change" (which can occur even if matches are found).]


RELATED LINK:

http://connect.microsoft.com/VisualStudio/feedback/details/733899/replace-all-says-zero-matches-but-find-next-finds-a-match




Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>