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
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.