3. Press Ctrl-h, check the regular exress. Fill "Find what:" to {:i}, "Replace with:" to "\1," and set "Look in:" to "Selection"
4. Click the "Replace All" button. The above text will become: A, PROVI,SI, B,
Correct replacement should be: A, PROVISI, B,
Note: In this example, the "Replace" button works. It behaves strange too in some other cases. It usually works fine if the "Look in:" is set to "Current document". It seems after selecting, the internal storage of text changed and messed up the parser of regular express finding routines.
This sounds like a problem in the base editor component. The editor developers are not experts in SQL Server tools, so it would help them to diagnose the problem if you could provide the following:
1) Text in the editor before the problem manifested itself 2) What UI gestures you made to see the problem (e.g. Highlight lines 1 - 4, click Edit | Find and Replace | Quick Replace, expand options in the replace dialog, ...) 3) What you expected to happen 4) What actually happened
I looked at the steps you did. You may miss one step that is necessary to produce the error:
- In the "Look in:" field, you must select "Selection" instead of "Current Document" or "All open document".
1) Have you changed any options in Tools | Options No
2) Is your operating system using English (United States) as its default region in Start > Control Panel > Regional and Language Options If not, what is the default region English as default region
3) Have you customized any regional options No
4) Do you have Visual Studio 2005 installed on the same machine Which edition Is it pre-release or RTM No
It's possible I'm misunderstanding the editor technology, but I think the first match found in the regular expression is called \0. \1 would be the second.
I did the following on my machine:
1) Start an editor 2) Type the following:
A PROVISI B
3) Select the text I typed, type ctrl-h 4) Check regular expression, enter "{:i}" in the "Find what" control and "\0," in the "Replace with" control, click "Replace All" button
Also, I can't reproduce this problem on my machine. When I use \1, the text becomes:
A, PROVISI, B,
We'll probably need more information to reproduce this:
1) Have you changed any options in Tools | Options 2) Is your operating system using English (United States) as its default region in Start > Control Panel > Regional and Language Options If not, what is the default region 3) Have you customized any regional options 4) Do you have Visual Studio 2005 installed on the same machine Which edition Is it pre-release or RTM 5) What OS are you running on
Management Studio Express CTP regular express replace bug?
jadams
siva_venugopal
onishin
1. Open a new query, and type the following text
A
PROVISI
B
2. Select the typed text.
3. Press Ctrl-h, check the regular exress. Fill "Find what:" to {:i}, "Replace with:" to "\1," and set "Look in:" to "Selection"
4. Click the "Replace All" button. The above text will become:
A,
PROVI,SI,
B,
Correct replacement should be:
A,
PROVISI,
B,
Note: In this example, the "Replace" button works. It behaves strange too in some other cases. It usually works fine if the "Look in:" is set to "Current document". It seems after selecting, the internal storage of text changed and messed up the parser of regular express finding routines.
edit_21
1) Text in the editor before the problem manifested itself
2) What UI gestures you made to see the problem (e.g. Highlight lines 1 - 4, click Edit | Find and Replace | Quick Replace, expand options in the replace dialog, ...)
3) What you expected to happen
4) What actually happened
TravisM727
- In the "Look in:" field, you must select "Selection" instead of "Current Document" or "All open document".
1) Have you changed any options in Tools | Options
No
2) Is your operating system using English (United States) as its default region in Start > Control Panel > Regional and Language Options If not, what is the default region
English as default region
3) Have you customized any regional options
No
4) Do you have Visual Studio 2005 installed on the same machine Which edition Is it pre-release or RTM
No
5) What OS are you running on
Windows XP
Perry
I did the following on my machine:
1) Start an editor
2) Type the following:
A
PROVISI
B
3) Select the text I typed, type ctrl-h
4) Check regular expression, enter "{:i}" in the "Find what" control and "\0," in the "Replace with" control, click "Replace All" button
result: the text becomes
A,
PROVISI,
B,
Is this what you were expecting
Marchionni Daniele
And even for \0, I got the following result after undo and try it the second time.
A,
PROVI,SI,
B
rpk_isv
This would probably be a defect in the common Visual Studio editor component. The best forum for discussing this would be the Visual Studio General forum (http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=25&SiteID=1).
Also, I can't reproduce this problem on my machine. When I use \1, the text becomes:
A,
PROVISI,
B,
We'll probably need more information to reproduce this:
1) Have you changed any options in Tools | Options
2) Is your operating system using English (United States) as its default region in Start > Control Panel > Regional and Language Options If not, what is the default region
3) Have you customized any regional options
4) Do you have Visual Studio 2005 installed on the same machine Which edition Is it pre-release or RTM
5) What OS are you running on
IbexMark