By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,742 Members | 1,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,742 IT Pros & Developers. It's quick & easy.

Regular Expressions in Visual Studio's Find & Replace

P: n/a
Could someone give me a very simple regular expression for Visual Studio's
search/replace using backreferences saving portions of the match as \1 or $1 or
whatever. I want to use something I can use in VS interactave search/replace, but
can't find the reference. Just a simple one is all I need.

Thanks - JackRazz at sbcglobal dot Net

Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
US Phone Number Match

((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"JackRazz" <Ja******@NotValid.com> wrote in message
news:Ox*************@TK2MSFTNGP11.phx.gbl...
Could someone give me a very simple regular expression for Visual Studio's
search/replace using backreferences saving portions of the match as \1 or $1 or whatever. I want to use something I can use in VS interactave search/replace, but can't find the reference. Just a simple one is all I need.

Thanks - JackRazz at sbcglobal dot Net


Nov 20 '05 #2

P: n/a
* "JackRazz" <Ja******@NotValid.com> scripsit:
Could someone give me a very simple regular expression for Visual Studio's
search/replace using backreferences saving portions of the match as \1 or $1 or
whatever. I want to use something I can use in VS interactave search/replace, but
can't find the reference.


Notice that there is a 'Help' button in the replace dialog box that
contains a description of the buttons and options in the dialog and
references to the documentation for the regular expression
search/replacement feature.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #3

P: n/a
Herfried,
I found that Help reference on regular expressions, but I missed that tag stuff
completely; mainly because I'm too new, didn't know what to look for, and needed an
example.

Thanks - JackRazz at sbcglobal dot net

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eS**************@TK2MSFTNGP10.phx.gbl...
| * "JackRazz" <Ja******@NotValid.com> scripsit:
| > Could someone give me a very simple regular expression for Visual Studio's
| > search/replace using backreferences saving portions of the match as \1 or $1 or
| > whatever. I want to use something I can use in VS interactave search/replace,
but
| > can't find the reference.
|
| Notice that there is a 'Help' button in the replace dialog box that
| contains a description of the buttons and options in the dialog and
| references to the documentation for the regular expression
| search/replacement feature.
|
| --
| Herfried K. Wagner [MVP]
| <URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
That did the trick.

Thanks - JackRazz at sbcglobal dot net

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:Ok****************@tk2msftngp13.phx.gbl...
| US Phone Number Match
|
| ((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}

|
| --
|
| OHM ( Terry Burns )
| . . . One-Handed-Man . . .
|
| Time flies when you don't know what you're doing
|
| "JackRazz" <Ja******@NotValid.com> wrote in message
| news:Ox*************@TK2MSFTNGP11.phx.gbl...
| > Could someone give me a very simple regular expression for Visual Studio's
| > search/replace using backreferences saving portions of the match as \1 or
| $1 or
| > whatever. I want to use something I can use in VS interactave
| search/replace, but
| > can't find the reference. Just a simple one is all I need.
| >
| > Thanks - JackRazz at sbcglobal dot Net
| >
| >
| >
| >
| >
|
|
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.