I want to know how this ambiguous pattern is solved in perl (in general, everything that libpcre uses):
/(\r\n|\r|\n)/
When the pattern sees \r\n, will it match once or twice? And what are the rules facing this situation?
\r\n
thank
It will match \r\nonce since Perl uses a regex engine that looks forward to change. See here .
, , , , . / , , . , regex regex|regex not regex not. - regex, . regex not, . , , , "".
regex|regex not
regex not
regex
, , . , "\r\n", . .
"\r\n"
... perl ( , , libpcre)
: Perl libpcre. PCRE , Perl Perl. PHP ActionScript libpcre, "Perl-" (, Python, Java .NET) .
, : , , , .
He will match him once. More details here: http://technocage.com/~caskey/dos2unix/
Source: https://habr.com/ru/post/1756957/More articles:Launching Silverlight Prism Command Using Keyboard Shortcut - c #Drawing jpg in MFC - c ++Style for Silverlight Text Box - c #How to create a method to return UIAlertViews? - objective-cDynamic HTML using Javascript - javascriptPHP: using scandir (), folders are processed as files - phpVisual Studio - SharePoint 2010 - Включите сборку> Быстрый вопрос - visual-studio-2010Findbugs "Method may not hide the stream" when using getResourceAsStream - javaRotate single row column T-SQL - dateuri_for includes the port number for forwarding - perlAll Articles