File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Regex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Regex" Watch "Regex" New topic
Author

Regex

Riyaz Saiyed
Greenhorn

Joined: Aug 13, 2006
Posts: 22

Output : 01234456
How come start could be 6 since there are total 6 character in string
and the index of f(last char) is 5?
Hans Beck�rus
Greenhorn

Joined: Aug 23, 2006
Posts: 24
I think we are aligned in our studies
I just posted the same question!
It is very confusing I agree. Hope someone can explain
the logic behind this output.

Maybe it is the terminating null character that matches the "*"?
In memory the string "ab34df" is actually represented as
"ab34df\0", so index 6 is the terminating null character which would
match the "0 or more" expression. But that I think is a very questionable
implementation of find() if this assumption is correct that find()
includes the \0 and returns 'true' for it.
[ September 25, 2006: Message edited by: Hans Beck�rus ]
Riyaz Saiyed
Greenhorn

Joined: Aug 13, 2006
Posts: 22
Is this assumption or real scenario...?
I'm confused yet...:-)
Hans Beck�rus
Greenhorn

Joined: Aug 23, 2006
Posts: 24
See Topic

I got a good answer on my question there.
[ September 25, 2006: Message edited by: Hans Beck�rus ]
Riyaz Saiyed
Greenhorn

Joined: Aug 13, 2006
Posts: 22
Ya...
I got it now...
Its really interesting...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regex