This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Java in General and the fly likes Trouble crafting regular expression. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Trouble crafting regular expression." Watch "Trouble crafting regular expression." New topic

Trouble crafting regular expression.

Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
I'm having difficulty crafting a regular expression to suit my needs. I want a match that begins with a particular word and ends on the next occurance of that word (non - inclusive):

As I said the match should be non-inclusive so that the next call to find() would begin with the target word. Any thoughts?

[ April 26, 2006: Message edited by: Garrett Rowe ]

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Henry Wong

Joined: Sep 28, 2004
Posts: 19937



Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Thanks Henry, works perfectly. The reluctant quantifyer was the part I was missing.
Consider Paul's rocket mass heater.
subject: Trouble crafting regular expression.
It's not a secret anymore!