Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes RegEx why does this simple expression not work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "RegEx why does this simple expression not work?" Watch "RegEx why does this simple expression not work?" New topic
Author

RegEx why does this simple expression not work?

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Anyone see the 'obvious' reason why my ReEx of

^/[a-z]+/[a-z]+/[a-z]+$
allows
/some/text/here

But the RegEx of
^/[a-z]+/[A-Za-z0-9]+/[a-z]+$
does not allow
/some/Text123/here

Surely (by my understanding) all I'm doing is extending the a-z to allow
uppercase & numeric characters.
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
OK forget it, it was/is working, it's just Eclipse being 'reliable'. A clean of my project and suddenly it seems the RegEx is a match!!!

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RegEx why does this simple expression not work?
 
Similar Threads
Please help me check this regex
Regex in Java: finding expression 1, but not if it's part of expression 2
How to mask string not conforming to a regular expression pattern
Regex
precedence prob. again..this time 4rm RHE...very urgent