Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

match regular expression against stream?

Thread view: 
Frank Fredstone - 02 Sep 2006 20:58 GMT
Is there a way to use Matcher on a stream of unknown length?

I've seen some examples using streams, but they either expect the
regular expression to be limited to matching lines, or the stream is
from a file where the complete length is known.

If I subclass CharSequence I need to know the entire length, so that's
out... Any ideas?
VisionSet - 02 Sep 2006 22:28 GMT
> Is there a way to use Matcher on a stream of unknown length?
>
[quoted text clipped - 4 lines]
> If I subclass CharSequence I need to know the entire length, so that's
> out... Any ideas?

I think the only possible solution would be to buffer the input and cache
the reg exps until they can be ruled out for sure. Each reg exp could be
paired with a pointer into the stream and the buffer can be flushed to the
point of the last cached pointer.

--
Mike W


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.