I want to include all special characters in regular expression in JFlex. So I prepared one as below.
P = ("_"|"-"|"/"|"."|","|"~"|"!"|"@"|"#"|"$"|"%"|"^"|"&"|"*"|"|"|"("|")"|"="|"+"|"|"|"\"|":"|";"|"""|"<"|">"|"?"|"`"|"{"|"}"|"["|"]"|"'")
Could somebody tell me is there any other way to cover all special characters in more optimized way?
Also could you please point out what's wrong in above regex as it is giving me "Unterminated string at end of line." error on compilation?