Tsallaka zuwa abun ciki
Justice Tech School

Regular Expressions

RegExp tests patterns and finds matches.

Example
var re = RegExp(r"(\d{3})-(\d{4})");
print(re.hasMatch("call 555-1234"));
var m = re.firstMatch("call 555-1234");
print(m!.group(1));
print("a1b22".replaceAll(RegExp(r"\d+"), "#"));

Exercise

Test a pattern.

re.("text")

Quiz Test

What does r"..." mean?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.