Solved

Regex problem in seeing numbers in string

Posted on 2009-02-17
3
185 Views
Last Modified: 2012-05-06
vb.net 2003

Access 2003

I have a string I'm examining during a regex.

temp = "CABLE TIE NATURAL 15 INCH"

When the regex sees this string "specifically the  "15"
temp = Regex.Replace(temp, " .5 ", " .5 0.5 .50 0.50 1/2 ")

It converts the string to
CABLE TIE NATURAL .5 0.5 .50 0.50 1/2 INCH  1/2~13
I'm not looking for ".5"  but  "15"   ???

Thanks
fordraiders





0
Comment
Question by:fordraiders
3 Comments
 
LVL 4

Expert Comment

by:RamanaChoudary
ID: 23661378
you can find all kind of regular expression here
http://regexlib.com/DisplayPatterns.aspx?cattabindex=2&categoryId=3
0
 
LVL 3

Author Comment

by:fordraiders
ID: 23661458
Thanks, but it does not answer the question directly...

I need to know why the 15  is converting to   .5 0.5 .50 0.50 1/2


sorry  "1/2~13"  is not the probem here my mistake for posting..
 
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 23663918
Regex.Replace(temp, " [.]5 ", " .5 0.5 .50 0.50 1/2 ")
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question