• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regex

 
Riyaz Saiyed
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this assumption or real scenario...?
I'm confused yet...:-)
 
Hans Beck�rus
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Topic

I got a good answer on my question there.
[ September 25, 2006: Message edited by: Hans Beck�rus ]
 
Riyaz Saiyed
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya...
I got it now...
Its really interesting...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic