我真的不熟悉 lex/flex。我正在尝试调试一些遗留的 flex 代码。我想查看与特定规则匹配的文本。
例如。
[a-z]* {"some C code" "need to print the string that matched this rule"}
Run Code Online (Sandbox Code Playgroud)
例如。如果johndoe@xyz.com 是输入,我需要打印匹配的字符串,即johndoe
我尝试打印yytext,但它只显示第一个字符。
R的plyr函数有:rbind.fill(),它是一种附加不等列数的数据帧的方法.
python/pandas DataFrame有类似的功能吗?