• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java regex method find(int index)  RSS feed

 
Lucky J Verma
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all ,

I am little confused about this method find(int startindex) used in Java Regex.

It means matching will start at the start index given (from input string)
but what happens at the next find.
foreg.
While(find(4))
{
//start looking from 4th index
//do something
}
After first iteration ,will it start from 0 or increment automatically from 4.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It uses the index, so it starts at position 4 again.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!