Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Need help on reqexp of a string
Topic Summary:
Created On: 21-Apr-2005 19:21
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 21-Apr-2005 19:21
User is offline View Users Profile Print this message


Ed Roland

Posts: 12
Joined: 13-Apr-2005

I have an input string that contain words in characters and numerics, I need to extract all numeric words and put them into a new string. Here is an exmple of a string:

string sTemp = "12345 something_here, 23456, text_again, 09876 56789"

Can anyone please help to extract the numerics from the above string.
So, it should return as "12345 23456 09876 56789".

I did look at the Regexp but couldn't get it work.

Thanks in advance!
Report this to a Moderator Report this to a Moderator
 21-Apr-2005 20:39
User is offline View Users Profile Print this message


Bruce Tuskey

Posts: 77
Joined: 2-Mar-2004

Try the code below. It is commented, so you should be able to adapt it for what you need.

-------------------------
Bruce Tuskey
Sr. Principle Engineer
Tuskey@gmail.com

"All that is gold does not glitter, not all those who wander are lost:..." - Gandalf the Grey (JRR Tolkien)

Edited: 21-Apr-2005 at 20:40 by Bruce Tuskey
Report this to a Moderator Report this to a Moderator
 22-Apr-2005 14:03
User is offline View Users Profile Print this message


Paul Worrall

Posts: 87
Joined: 30-Sep-2003

Or a bit simpler:
Report this to a Moderator Report this to a Moderator
 22-Apr-2005 15:05
User is offline View Users Profile Print this message


Ed Roland

Posts: 12
Joined: 13-Apr-2005

Thanks Bruce and Paul, both answers work great!
Thanks again for all your help!!!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.