470,590 Members | 2,456 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,590 developers. It's quick & easy.

regexp replace question

Hello,

I'm new to VB.NET but have used regexp in Perl and VI.

I'd like to read a regular expression from a file and apply it to a
string read from another file. The regexp is simple word replace
operation, so my input regexp file lines might look like this:

/foo/bar/

So if a line in input file looked like "I'd like to foo", then the
output line would be "I'd like to bar".

It seems so simple, but I can't find the right form.

--
Cheers,

bill
Nov 21 '05 #1
2 1367
Dont know abt the regex part.
But if you have reached the point when you know you need to convert this
string to that,

Then you can use String.Replace method

I hope the initial part wasnt the real problem :-)

HTH
rawCoder
"Bill McCormick" <so*******@yahoo.com> wrote in message
news:Fw****************@newssvr14.news.prodigy.com ...
Hello,

I'm new to VB.NET but have used regexp in Perl and VI.

I'd like to read a regular expression from a file and apply it to a
string read from another file. The regexp is simple word replace
operation, so my input regexp file lines might look like this:

/foo/bar/

So if a line in input file looked like "I'd like to foo", then the
output line would be "I'd like to bar".

It seems so simple, but I can't find the right form.

--
Cheers,

bill

Nov 21 '05 #2
rawCoder said the following on 9/8/2005 12:50 PM:
Dont know abt the regex part.
But if you have reached the point when you know you need to convert this
string to that,

Then you can use String.Replace method

Understood. But I'd like to know how to do it with regexp.


I hope the initial part wasnt the real problem :-)

HTH
rawCoder
"Bill McCormick" <so*******@yahoo.com> wrote in message
news:Fw****************@newssvr14.news.prodigy.com ...
Hello,

I'm new to VB.NET but have used regexp in Perl and VI.

I'd like to read a regular expression from a file and apply it to a
string read from another file. The regexp is simple word replace
operation, so my input regexp file lines might look like this:

/foo/bar/

So if a line in input file looked like "I'd like to foo", then the
output line would be "I'd like to bar".

It seems so simple, but I can't find the right form.

--
Cheers,

bill



--
Cheers,

bill
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by McKirahan | last post: by
5 posts views Thread by Dr John Stockton | last post: by
4 posts views Thread by Ian Renfrew | last post: by
13 posts views Thread by Phat G5 (G3) | last post: by
6 posts views Thread by Matt | last post: by
7 posts views Thread by Csaba Gabor | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.