I have a regex that I'm testing a character input stream. I wonder if there is a way to match the regex to the input and determine if this is a partial match that consumes the entire input buffer? That is, the end of the input buffer will be reached before regexp completes. I would like the implementation to decide whether to wait for more character input or to abort the operation.
In other words, I need to determine which one is true:
The end of the input buffer was reached before regex matching
eg. "foo" =~ /^foobar/
"foo" =~ /^foobar/
Regular expression is exactly the same as
eg. "foobar" =~ /^foobar/
"foobar" =~ /^foobar/
Regular expression does not match
eg. "fuubar" =~ /^foobar
"fuubar" =~ /^foobar
Entrance is not packetized.
, ? , . 'Foobar'. , . 'foo', . , .
, . ,
If (input.Length < target.Length && target.StartsWith(input)) // keep trying
, , . , , .
, , . , . . , .
, , , .
.
- , , ( , ). . , , .
: /(<function.*?>)|([^<]*)/ , / , 2.
/(<function.*?>)|([^<]*)/
, , , , .
: 64 . 10. . (64k - 10) , 10 . (64k-10) . , 10 , / 1 , .
, /, .
Source: https://habr.com/ru/post/1786920/More articles:How can I find out if a txt file is binary or using its contents? - c #Modifier Question in Java Grammar - javaA deal in sight with Hibernate, Spring, Struts - springDoes WCFStorm support calling WCF services with JSON enabled? - jsonDelphi - Authentication Engine Offers - authenticationHow to prevent replaceWith from creating multiple text nodes? - jqueryкак я могу показать изображение в аннотации на карту? - iphoneчто является правильным синтаксисом xml для определения элемента формы в форме zend - xmlError generating .zip files in prod (Rails 3) - ruby | fooobar.comhow can I make a method call from a specific versioned jar when several versions are present - javaAll Articles