Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Zero length matches??

 
Hareendra Reddy
Ranch Hand
Posts: 173
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
The following code splits the string into 4 strings out of them 3 of are zero length...
I thought i was strong in determining zero length matches..


Can someone suggest me any reference or tutorials regular expressions particularly zero length macthes....
 
Shahrukh Naqui
Greenhorn
Posts: 14
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The best brief lesson/tutorial that I found was Sun's own Java regex tutorial.

Zero length matches are well explained in the Quantifiers section of the tutorial.
 
Hareendra Reddy
Ranch Hand
Posts: 173
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sharukh for reply,
I already read that tutorial and i think understood the concept well...
but i need more deep disussion about zero length matches particular...
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this help ?



A zero length string is still a match. It is the empty string that resides between two "aaa" strings.
 
Hareendra Reddy
Ranch Hand
Posts: 173
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Deepak ...
I understood that problem ..
I want to read more about zero length matches...
can you suggest me some references??
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hareendra Reddy wrote:Thank you Deepak ...
I understood that problem ..
I want to read more about zero length matches...
can you suggest me some references??


You can dive into the Pattern and Matcher implementations and knock yourself out. Those are the best references
 
Hareendra Reddy
Ranch Hand
Posts: 173
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Deepak..
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are books available on regular expressions like "Mastering Regular Expressions" or "Java Regular Expressions" which you can go through if you want in-depth knowledge of regular expressions...
 
Shahrukh Naqui
Greenhorn
Posts: 14
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is also this Regular expressions website, if you haven't found it already. Its quite detailed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic