• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String matches

 
Ranadhir Nag
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic