Solved

Regex problem in seeing numbers in string

Posted on 2009-02-17
3
180 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
Comment Utility
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
Comment Utility
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
Comment Utility
Regex.Replace(temp, " [.]5 ", " .5 0.5 .50 0.50 1/2 ")
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now