[英]Regular expression to identify two same consecutive line
I am parsing one file using flex/bison and I want to know how to identify same consecutive line. 我正在使用flex / bison解析一个文件,我想知道如何识别同一连续行。
Example:
BEGIN BLOCK BLK1
BEGIN BLOCK BLK_ROWDEC
How can I write regular expression to identify this two line that starting with BEGIN. 如何编写正则表达式来标识以BEGIN开头的这两行。
I have tried 我努力了
^BEGIN(.*)\r?\n^BEGIN(.*)
But it is not identifying my string. 但这不能识别我的字符串。
Please help me to parse this string. 请帮助我解析此字符串。
下面的正则表达式将识别这两行。
^BEGIN(.*)\r?\n+\s*BEGIN(.*)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.