Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Regular Expressions in Java throws StackOverflow Exception

3 views
Skip to first unread message

sravan

unread,
Sep 3, 2004, 12:49:15 PM9/3/04
to
I was just trying to use a regular expression for finding me the
patterns which match

X(\\n|\\r|.)*? Y

What this means is to find the pattern which matches any String that
starts with X followed by any number of characters or new lines or new
carriage returns and finally followed by Y.

To summarize find the pattern which matches the block X ........ Y
which can be separated by any characters/newlines/tabs etc.

Ex:

X


AFJALFJA

Y

should be selected.

When i use the pattern shown above the java prog throws me
StackOverflow exception. Can you throw me some light into
pattern/expression modification??

Thanx
Sravan

0 new messages