문제

How can I write a regular definition in (f)lex for quoted strings from AT&T language?

Example of string that come to my mind:

  • "abc"
  • "a\"bc"
  • "abc\"
  • "abc\""

Later edit:

  • "abc" "def" should be matched as two strings
  • "ab\"c" "def" should be matched as two strings
  • "abc\" "def" should be matched as two strings

The definition \"[^\"]\" is not working because it will match "abc" "def" as one string.

도움이 되었습니까?

해결책

could you be more specific as to what strings you are trying to match? Strings that start and end with "? What do you mean by AT&T language?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top