JLex文件的内容:
//Main
%%
//Possible text of file: {This is a comment}
Comments=[\{][.*][\}]
Whitespaces=[\ \r\n]
%%
{Comments}{System.out.println("Line"+(yyline+1)+" Comments\t"+yytext());}
{Whitespaces}{}
问题:
{
和}
作为评论期望:
{
和}
内的内容应该被识别为评论(以及{
,}
)这个正则表达式有问题吗?
正则表达式:
[\{][.*][\}]
非常感谢你的时间!