This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Zero length matches??  RSS feed

 
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....
 
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...
 
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..
 
Sheriff
Posts: 9611
37
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.
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!