-
i expected |
Beta Was this translation helpful? Give feedback.
Answered by
renggli
Jun 6, 2024
Replies: 1 comment
-
Correct, have a look at the method documentation: /// Returns a parser that accepts a single character of a given character set
/// provided as a string.
///
/// Characters match themselves. A dash `-` between two characters matches the
/// range of those characters. A caret `^` at the beginning negates the pattern.
///
/// For example, the parser `pattern('aou')` accepts the character 'a', 'o', or
/// 'u', and fails for any other input. The parser `pattern('1-3')` accepts
/// either '1', '2', or '3'; and fails for any other character. The parser
/// `pattern('^aou') accepts any character, but fails for the characters 'a',
/// 'o', or 'u'.
@useResult
Parser<String> pattern(String element, [String? message]) =>
SingleCharacterParser(_pattern.parse(element).value,
message ?? '[${toReadableString(element)}] expected'); There is a parser that works on any |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
renggli
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Correct, have a look at the method documentation: