Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Regular Expression to extract all numbers from a string to a group collection

Reply
Thread Tools

Regular Expression to extract all numbers from a string to a group collection

 
 
Jay Douglas
Guest
Posts: n/a
 
      08-27-2004
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.



 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      08-27-2004
reverse it, replace all non numerics to blank/empty and ta-da, numbers only

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


"Jay Douglas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>



 
Reply With Quote
 
 
 
 
Niki Estner
Guest
Posts: n/a
 
      08-27-2004
"Jay Douglas" <(E-Mail Removed)> wrote in
news:(E-Mail Removed)...
> 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.


How about: RegEx.Matches(@"\b\d+\b")?


 
Reply With Quote
 
Jay Douglas
Guest
Posts: n/a
 
      08-27-2004
Perfect. Thank you.




"Niki Estner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Jay Douglas" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed)...
> > 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.

>
> How about: RegEx.Matches(@"\b\d+\b")?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
Regular Expression extract all links in a page. smartestdesign@gmail.com Java 1 08-07-2006 01:19 AM
Please help with regular expression (string must be letter plus 5 numbers) paulsmith5@hotmail.com ASP .Net 2 04-21-2006 04:09 PM
Please help with regular expression (string must be letter plus 5 numbers) paulsmith5@hotmail.com Javascript 1 04-21-2006 03:04 PM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments