是否可以使用正则表达式提取子字符串lex
,就像可以使用sed
?
例如
sed -e 's/[0-9]*\([a-z]*\)[0-9]*/\1/'
将从中提取或foo
从34234foo777
bar
123bar456
是否可以像这样使用 lex 来做到这一点:
[0-9]*\([a-z]*\)[0-9]* printf("alphabetical substring is %s\n", /*what?? \1 ??*/);
yytext
不通过普通 C解析?