[Flex-help] Including Newline and Carriage Return in yytext
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Allen B. <Al...@ep...> - 2014-12-11 21:21:45
|
I am struggling to get the newline and carriage return characters to appear in the yytext "buffer." For instance let's say I was trying to match with the rule: MY[ ]STRING=.*\r?\n { memcpy(my_buf,yytext,yyleng); } Which you can see copies the buffer exactly to my_buf. Unfortunatly I only get the portion of the string matched by MY[ ]STRING=.* but not the optional carriage return or newline character. How does one change this behavior? |