471,623 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Replacing special chars using regular expressions

The issue at hand, I believe is my comprehension of using regular
expression, specially to assist in replacing the expression with other text.
using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.

This search
ElseIf InStr(1, indivline, "$") Then
insert a replace statement that uses the regular expression to find and
replace all the white space between the character sets

returns
C$ NTFS 34168 18461 15707 'there could be one or more
occurrences. No problem finding them
leading spaces before the C$
spaces between C$ and NTFS
tab and spaces after NTFS and first set of numbers
spaces between remaining sets of numbers (not always consistent on the
number of spaces) and ending with a carriage return

using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.
I have imported system.text.regularexpression
issue is I am just not getting it trying to use the regular expression, but
I believe it is the better solution.
Nov 21 '05 #1
3 3074
James,

I don't know who are active this weekend

The regular expression is not my stuff, however here a nice link for that.
http://www.regexlib.com/REDetails.aspx?regexp_id=464

Merry Christmas

Cor

"James D. Marshall" <cr**********@hotmail.com>
The issue at hand, I believe is my comprehension of using regular
expression, specially to assist in replacing the expression with other
text.
using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.

This search
ElseIf InStr(1, indivline, "$") Then
insert a replace statement that uses the regular expression to find and
replace all the white space between the character sets

returns
C$ NTFS 34168 18461 15707 'there could be one or
more occurrences. No problem finding them
leading spaces before the C$
spaces between C$ and NTFS
tab and spaces after NTFS and first set of numbers
spaces between remaining sets of numbers (not always consistent on the
number of spaces) and ending with a carriage return

using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.
I have imported system.text.regularexpression
issue is I am just not getting it trying to use the regular expression,
but I believe it is the better solution.

Nov 21 '05 #2
Thank You
Yes this did help, although I didn't use the exact same string as below.
Followed the links to a neat tool called "The Regulator" and was able to
build the regular expression pattern. Now to get the replace to work with
regular expressions.
"Cor Ligthert" <no************@planet.nl> wrote in message
news:eK**************@tk2msftngp13.phx.gbl...
James,

I don't know who are active this weekend

The regular expression is not my stuff, however here a nice link for that.
http://www.regexlib.com/REDetails.aspx?regexp_id=464

Merry Christmas

Cor

"James D. Marshall" <cr**********@hotmail.com>
The issue at hand, I believe is my comprehension of using regular
expression, specially to assist in replacing the expression with other
text.
using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.

This search
ElseIf InStr(1, indivline, "$") Then
insert a replace statement that uses the regular expression to find
and replace all the white space between the character sets

returns
C$ NTFS 34168 18461 15707 'there could be one or
more occurrences. No problem finding them
leading spaces before the C$
spaces between C$ and NTFS
tab and spaces after NTFS and first set of numbers
spaces between remaining sets of numbers (not always consistent on the
number of spaces) and ending with a carriage return

using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.
I have imported system.text.regularexpression
issue is I am just not getting it trying to use the regular expression,
but I believe it is the better solution.


Nov 21 '05 #3
Thanks for all the assistance, have the console app and running, it
completed its task in just over 6 minutes, compare that over 2 hours for
what one person wrote using java (another example why java is really a
virus) oooops, am I gonna pay for that remark.
"James D. Marshall" <cr**********@hotmail.com> wrote in message
news:am0zd.807452$8_6.531355@attbi_s04...
The issue at hand, I believe is my comprehension of using regular
expression, specially to assist in replacing the expression with other
text.
using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.

This search
ElseIf InStr(1, indivline, "$") Then
insert a replace statement that uses the regular expression to find and
replace all the white space between the character sets

returns
C$ NTFS 34168 18461 15707 'there could be one or
more occurrences. No problem finding them
leading spaces before the C$
spaces between C$ and NTFS
tab and spaces after NTFS and first set of numbers
spaces between remaining sets of numbers (not always consistent on the
number of spaces) and ending with a carriage return

using regular expression (\s*) my understanding is that this will one or
more occurrences to replace all the white space between with a comma.
I have imported system.text.regularexpression
issue is I am just not getting it trying to use the regular expression,
but I believe it is the better solution.

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Martin | last post: by
14 posts views Thread by tertius | last post: by
7 posts views Thread by Mindy Geac | last post: by
11 posts views Thread by Dimitris Georgakopuolos | last post: by
7 posts views Thread by arno | last post: by
5 posts views Thread by M Kinnear | last post: by
11 posts views Thread by tech | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

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.