By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Replacing special chars using regular expressions

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.