473,225 Members | 1,344 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,225 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 3187
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Martin | last post by:
I have a HTML parser that reads product pages from various retailers - and I want to optimize it somewhat: I download all HTML before I start the parsing - and to do that I want to: - Get rid...
14
by: tertius | last post by:
Is there a better way to append certain chars in a string with a backslash that the example below? chr = "#$%^&_{}" # special chars to look out for str = "123 45^ & 00 0_" # string to...
7
by: Mindy Geac | last post by:
Is it possible to delete special caracters from a string and multiple spaces? When the input is : "a&*bbb cc/c d!d" I want the result : "abbb ccc dd" thnx. MJ <?php
4
by: Ewok | last post by:
let me just say. it's not by choice but im dealing with a .net web app (top down approach with VB and a MySQL database) sigh..... Anyhow, I've just about got all the kinks worked out but I am...
11
by: Dimitris Georgakopuolos | last post by:
Hello, I have a text file that I load up to a string. The text includes certain expression like {firstName} or {userName} that I want to match and then replace with a new expression. However,...
7
by: arno | last post by:
Hi, I want to search a substring within a string : fonction (str, substr) { if (str.search(substr) != -1) { // do something } }
5
by: M Kinnear | last post by:
I want to check a string only contains a-z 0-9 ( ) . and # I've used ereg("^*)$"),$instr) which parses a string correctly until I try and parse a !,",,$ ... or any of the other...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
11
by: tech | last post by:
Hi, I need a function to specify a match pattern including using wildcard characters as below to find chars in a std::string. The match pattern can contain the wildcard characters "*" and "?",...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.