Replacing special chars using regular expressions

J

James D. Marshall

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.
 
J

James D. Marshall

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.
 
J

James D. Marshall

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top