Skip to content

Instantly share code, notes, and snippets.



Last active Jun 14, 2019
What would you like to do?
package metaobjectTest
This is a literal string annotation, an identifier precedes a literal
string. The string should be a regular expression as expected by
prototype cyan.lang.RegExpr. The same regular expression language
is used by java.util.regex.Pattern. The annotation
r"regexpr" or R"regexpr"
is replaced by
object String_r_R
func run {
var ok = "aabc" ~= r"a*b*c";
assert ok;
ok = "aabc" ~= r"a+b*c+";
assert ok;
ok = "0bc" ~= R"[0-9]b*cc*";
assert ok;
ok = "012aaabbc" ~= R"[0-2]*a+D?b*c";
assert ok;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment