473,326 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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 1461
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: McKirahan | last post by:
How would I use a regular expression to remove all trailing Carriage Returns and Line Feeds (%0D%0A) from a textarea's value? Thanks in advance. Also, are they any great references for learning...
5
by: Dr John Stockton | last post by:
ISTM that RegExps deserve a FAQ entry, with links to more detailed sources. An important question, probably not treated by many otherwise worthwhile sources, must be on feature detection of the...
4
by: Ian Renfrew | last post by:
To replace characters, I currently run the following code: oStr = oStr.replace(/\xFC/g,"\t"); // replace sub-value mark(s) with tab(s) Ideally, I'd like to replace the hard coded string \xFC...
4
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
13
by: Phat G5 (G3) | last post by:
I am weak when it comes to regexp but hoped someone might know in this case. I am trying to take a url like this : something.lasso?blah=blah&blah2=blah2&sort=hello&blah3=blah3 And remove the...
6
by: jiing24 | last post by:
I try to use regexp to replace some html tags in DOM, but the result seems some problems, ================================ <Script language="javascript" type="text/javascript"> var config =...
6
by: Matt | last post by:
Premise: Inserting data into a database form a <textarea> and displaying this data through an HTML page. When inserting data into a database via a text area and then displaying this data any...
7
by: Csaba Gabor | last post by:
I need to come up with a function function regExpPos (text, re, parenNum) { ... } that will return the position within text of RegExp.$parenNum if there is a match, and -1 otherwise. For...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.