This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String matches Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String matches" Watch "String matches" New topic
Author

String matches

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
I have a arraylist which contains the nodes of an xml.
One typical node is "<event id="...">".
How do i find this entry using the ListIterator.
I tried :
ListIterator steitr=......;
while(setitr.hasPrevious())
{
String elementvalue=(String)setitr.previous();
elementvalue=elementvalue.trim();

if((elementvalue.matches("<event\\s*id")) && (.....))
{
....
}

}


How do I use matches(regex) to find this entry.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String matches
 
Similar Threads
How to transform this?
Assigning iterators
Traversing an ArrayList
HttpServlet Request getParameter automatic converting
jQuery Validator and select