• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Zero length matches??

 
Ranch Hand
Posts: 173
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MyEclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Deepak..
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is also this Regular expressions website, if you haven't found it already. Its quite detailed.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic