473,396 Members | 1,816 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,396 software developers and data experts.

Regular Expression questions

Hi

I am new to using regular expressions in VB.NET, and need a bit of help.

I am trying to parse a string that looks like this:
~datastart some variable numbers, characters and spaces of unknown length~
to get this
~datastart~

I tried this:
strWorkingData = Regex.Replace(strWorkingData, "~datastart*~",
"~datastart~")
but it returned the starting value

Any help would be appreciated (including any good resources on how to use
regular expressions)

Thanks for the help

Derrick
Nov 20 '05 #1
4 780
try ~(datastart[^~]*)~

that might work.

test string "fjsgf~datastart453~~~~3232~datastart.--$#2~#@@~datastart @//+_)(*&^@ 4 ~fdas#@$#@fdsfd" should return 3 matches.
----- Derrick wrote: -----

Hi

I am new to using regular expressions in VB.NET, and need a bit of help.

I am trying to parse a string that looks like this:
~datastart some variable numbers, characters and spaces of unknown length~
to get this
~datastart~

I tried this:
strWorkingData = Regex.Replace(strWorkingData, "~datastart*~",
"~datastart~")
but it returned the starting value

Any help would be appreciated (including any good resources on how to use
regular expressions)

Thanks for the help

Derrick

Nov 20 '05 #2
try ~(datastart[^~]*)~

that might work.

test string "fjsgf~datastart453~~~~3232~datastart.--$#2~#@@~datastart @//+_)(*&^@ 4 ~fdas#@$#@fdsfd" should return 3 matches.
----- Derrick wrote: -----

Hi

I am new to using regular expressions in VB.NET, and need a bit of help.

I am trying to parse a string that looks like this:
~datastart some variable numbers, characters and spaces of unknown length~
to get this
~datastart~

I tried this:
strWorkingData = Regex.Replace(strWorkingData, "~datastart*~",
"~datastart~")
but it returned the starting value

Any help would be appreciated (including any good resources on how to use
regular expressions)

Thanks for the help

Derrick

Nov 20 '05 #3
Thank you - That worked perfectly.

Derrick

"tMan" <an*******@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
try ~(datastart[^~]*)~

that might work.

test string "fjsgf~datastart453~~~~3232~datastart.--$#2~#@@~datastart @//+_)(*&^@ 4 ~fdas#@$#@fdsfd" should return 3 matches.

----- Derrick wrote: -----

Hi

I am new to using regular expressions in VB.NET, and need a bit of help.
I am trying to parse a string that looks like this:
~datastart some variable numbers, characters and spaces of unknown length~ to get this
~datastart~

I tried this:
strWorkingData = Regex.Replace(strWorkingData, "~datastart*~",
"~datastart~")
but it returned the starting value

Any help would be appreciated (including any good resources on how to use regular expressions)

Thanks for the help

Derrick

Nov 20 '05 #4
Thank you - That worked perfectly.

Derrick

"tMan" <an*******@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
try ~(datastart[^~]*)~

that might work.

test string "fjsgf~datastart453~~~~3232~datastart.--$#2~#@@~datastart @//+_)(*&^@ 4 ~fdas#@$#@fdsfd" should return 3 matches.

----- Derrick wrote: -----

Hi

I am new to using regular expressions in VB.NET, and need a bit of help.
I am trying to parse a string that looks like this:
~datastart some variable numbers, characters and spaces of unknown length~ to get this
~datastart~

I tried this:
strWorkingData = Regex.Replace(strWorkingData, "~datastart*~",
"~datastart~")
but it returned the starting value

Any help would be appreciated (including any good resources on how to use regular expressions)

Thanks for the help

Derrick

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Patient Guy | last post by:
Coding patterns for regular expressions is completely unintuitive, as far as I can see. I have been trying to write script that produces an array of attribute components within an HTML element. ...
3
by: Joe | last post by:
Hi, I have been using a regular expression that I don’t uite understand to filter the valid email address. My regular expression is as follows: <asp:RegularExpressionValidator...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
8
by: Michael Primeaux | last post by:
I'm somewhat new to regular expressions and am in need of assistance. I'd like to match on any OBJECT, EMBED, or APPLET element nested inside an <HTML> element. Would someone point me in the right...
15
by: Mark Rae | last post by:
Hi, I'm trying to construct a RegEx pattern which will validate a string so that it can contain: only the numerical characters from 0 to 9 i.e. no decimal points, negative signs, exponentials...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
3
by: Zeba | last post by:
Hi guys, I need some help regarding regular expressions. Consider the following statement : System.Text.RegularExpressions.Match match =...
5
by: laredotornado | last post by:
Hi, I have a span that contains text of the form var spanHtml = "My Tab Content (7)"; The content is guaranteed to end with a string of the form "(#)" where "#" is a whole number. My...
12
by: joey.powell | last post by:
Hello guys, I am primarily an asp.net programmer, but lately I've been doing some work with Apache, MySQL and PHP. Anyways, I have a question that I posted in the microsoft asp.net newsgroup....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.