472,792 Members | 3,626 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,792 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 1434
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
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.