Skip to content

[QUESTION] Escaping circumflex possible? #12

Description

@othmar52

I wondered how to escape the circumflex char ^
My input is SETD^i.11.mix^0.1015118791 and i want to capture 11 and 0.1015118791
when i replace the circumflex with \094 the callback seems to run endlessly
@nickgammon Do you have an idea how to write the regex?

  char buf [100] = "SETD^i.11.mix^0.1015118791";
  MatchState ms (buf);
  count = ms.GlobalMatch ("^i.(%d+).mix^([%d.]+)", match_callback); // no match
  count = ms.GlobalMatch ("^i.(%d+).mix", match_callback); // no match
  count = ms.GlobalMatch ("\^i.(%d+).mix", match_callback); // no match
  count = ms.GlobalMatch ("\\^i.(%d+).mix", match_callback); // no match
  count = ms.GlobalMatch ("\094i.(%d+).mix", match_callback); // endless loop in callback

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions