visual studio find / replace regular expressions

Hi

in the find/replace box for visual studio you can use regular expressions. i had a go with it but i think regular expressions in vb might eb slightly different than perl.

how do i write a regular expression for use in this dialogue that can remember the matched text.

For example, lets say i had this text:

ssss hello everyone ssss

and i wanted to replace it with

aaaa hello everyone aaaa

how would i do that? i need to remember the "hello everyone" bit

Thanks very much
andrea
andiejeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi andieje;

Here is a link to the documentation for Visual Studio Regular Expression used in the IDE find/replace'

http://msdn2.microsoft.com/en-US/library/2k3te2cs(VS.80).aspx

In your example you want to replace the ssss in "ssss hello everyone ssss" With aaaa.

Then do the following in the Replace dialog box:
Find What: = <s^4>
Replace With: = aaaa

Fernando
andiejeAuthor Commented:
I'm sorry, i posted late last night and was being a bit thick

What i need to be able to do is this....

hello everyone aaaa

to

aaaa hello everyone aaaa

I need to really insert some text around existing text
Fernando SotoRetiredCommented:
New example:

From this:

hello everyone aaaa

To this:

aaaa hello everyone aaaa

Then do the following in the Replace dialog box:
Find What: = {<hello everyone>} {<a^4>}
Replace With: = \2 \1 \2

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andiejeAuthor Commented:
Marvellous - that was what i was looking for!

Thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.