SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 8th, 2008, 05:26 PM
linuxChique's Avatar
linuxChique linuxChique is offline
watch for flying fingers
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2003
Location: Rocket City, USA
Posts: 744 linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 33845 Folding Title: Starter FolderFolding Points: 33845 Folding Title: Starter Folder
Time spent in forums: 4 Days 9 h 40 m 57 sec
Reputation Power: 252
Send a message via ICQ to linuxChique Send a message via AIM to linuxChique Send a message via MSN to linuxChique Send a message via Yahoo to linuxChique Send a message via Google Talk to linuxChique
Extract regex-type substring from string

I have a glob of XML data in a String object that includes a bunch of newlines. I need to find the substring

Quote:
<step id="1" name="Triage">


given the string "Triage" and extract the id from it. I have looked at the String documentation here but I can't find anything that matches what I need to do. The string I'll be given will almost always exist in more than one place in the XML, so I can't just do an indexOf and back up a certain number of chars. Any ideas?
__________________

Reply With Quote
  #2  
Old May 8th, 2008, 05:49 PM
linuxChique's Avatar
linuxChique linuxChique is offline
watch for flying fingers
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2003
Location: Rocket City, USA
Posts: 744 linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)linuxChique User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 33845 Folding Title: Starter FolderFolding Points: 33845 Folding Title: Starter Folder
Time spent in forums: 4 Days 9 h 40 m 57 sec
Reputation Power: 252
Send a message via ICQ to linuxChique Send a message via AIM to linuxChique Send a message via MSN to linuxChique Send a message via Yahoo to linuxChique Send a message via Google Talk to linuxChique
I found the solution in the regex classes.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Extract regex-type substring from string


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway