0

I want to make a rule in flex to consume c-style strings from the following pattern:
1) Letters between " " , for example: "str".
2) Can be any of the letter ASCII that can bet printed apart of the following symbols: \ or " or only \n.

For example:
"strsr"
"also're\n"

I know that I can to do it with "start conditions" but I don't know how to do it.

aminography
  • 21,986
  • 13
  • 70
  • 74
MathQues
  • 129
  • 1
  • 10
  • 2
    Does this answer your question? [What is regular expression for multi string?](https://stackoverflow.com/questions/43048602/what-is-regular-expression-for-multi-string) – Brian Tompsett - 汤莱恩 Nov 06 '19 at 11:36
  • @BrianTompsett-汤莱恩 but it's not good: `"\n"` – MathQues Nov 06 '19 at 11:48
  • 1
    @mathques: could you be more specific about the problem? Are you talking about the pattern in that question or the pattern in the answer? – rici Nov 06 '19 at 14:09
  • OK, here's an answer which includes start conditions for parsing strings: https://stackoverflow.com/questions/42354725/optimizing-flex-string-literal-parsing/42358417. And one more answer with a flex pattern: https://stackoverflow.com/questions/43048602/what-is-regular-expression-for-multi-string – rici Nov 08 '19 at 16:22

0 Answers0