S
Stanimir Stamenkov
Is it possible to detect a partial match at the end of the supplied
data?, i.e.:
String data = "A regular expression, specified as a string,
must first be compiled into an instance of this class. The resulting
pattern can then be used";
String search = "can then be used to create";
Pattern pattern = Pattern.compile(search);
Matcher matcher = pattern.matcher(data);
matcher.find();
...
It is obvious the above won't match but then the initial data is
only a chunk from an input stream (for example), so I want to detect
if the pattern has been partially matched and at which position the
partial match begins so I could prepend it to the next data chunk
and continue matching.
data?, i.e.:
String data = "A regular expression, specified as a string,
must first be compiled into an instance of this class. The resulting
pattern can then be used";
String search = "can then be used to create";
Pattern pattern = Pattern.compile(search);
Matcher matcher = pattern.matcher(data);
matcher.find();
...
It is obvious the above won't match but then the initial data is
only a chunk from an input stream (for example), so I want to detect
if the pattern has been partially matched and at which position the
partial match begins so I could prepend it to the next data chunk
and continue matching.