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

Q: extract numbers

Hello all,

I have string like this one (simplified): "( xxxx = 22 ) , ( yyy = 123)"
I can write a proc for reading char by char in string and extract numerics
but this doesn't look like so elegant way...
I'll appreciate all ideas.

Thanks in advance.
Apr 12 '06 #1
2 1242
dear dllhell,

use regular expressions::.....

String yourInputString = "( xxxx = 22 ) , ( yyy = 123)" ;
Regex digitreg = new Regex("\\d+");
MatchCollection mc = digitreg.Matches(yourInputString);
foreach(Match dig in mc)
{
MessageBox.Show(dig.tostring());
}

regards,
Mehboob

Apr 12 '06 #2

"Khadim" <as***********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
dear dllhell,

use regular expressions::.....


Thanks Khadim
this is much inteligent way then I intend to to :))
Apr 12 '06 #3

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

Similar topics

2
by: Lydia Shawn | last post by:
hi there, i want to extract the numbers from this example input: bla trigger3 trigger4 trigger1 blabla trigger1 5000.00 trigger3 trigger1 trigger2 trigger2 600.00 trigger4 trigger1 50.00...
7
by: William Payne | last post by:
Hello, I have a variable of type unsigned long. It has a number of bits set (with set I mean they equal one). I need to determine those bits and their position and create new numbers from them. For...
4
by: Ryan | last post by:
I am trying to write a c# function to extract all numbers out of a string. What is the easiest way to do this, regular expressions? I must account for numbers formatted with or without commas...
3
by: Jay Douglas | last post by:
Hello all. I'm having a hard time coming up with a regular expression that can extract just the numbers out of string into a GroupCollection. Any help is appreciated.
3
by: zek2005 | last post by:
Hi friends! I have a varchar field in my DB with numeric values separates by spaces. I need to extract the numbers to create an array. Example 1: 1820 1823 1825 --> need to be transform into ...
6
by: Dave | last post by:
Hope someone can help! I have a memo fiels in which there are a few numbers including dates but what I want to do is extract a number which is 6 figures long. Can anyone help me? Thanks Dave
8
by: Fabian Braennstroem | last post by:
Hi, I would like to remove certain lines from a log files. I had some sed/awk scripts for this, but now, I want to use python with its re module for this task. Actually, I have two different...
0
by: napolpie | last post by:
DISCUSSION IN USER nappie writes: Hello, I'm Peter and I'm new in python codying and I'm using parsying to extract data from one meteo Arpege file. This file is long file and it's composed by...
5
by: Steve | last post by:
Hi all Does anybody please know a way to extract an Image from a pdf file and save it as a TIFF? I have used a scanner to scan documents which are then placed on a server, but I need to...
1
Thekid
by: Thekid | last post by:
Hi, I have an image similar to a clock, with numbers and letters going around in a circle. I need to extract the numbers and letters from the image and have them print out in a straight line and in...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.