Skip to content

Instantly share code, notes, and snippets.

@joseoliv joseoliv/String_r_R.cyan
Last active Jun 14, 2019

Embed
What would you like to do?
string_r_R
package metaobjectTest
@doc{*
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
RegExpr("regexpr")
*}
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;
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.