matchTags function
Implementation
int matchTags(String str, String char, RegExp r) {
//TODO: In future check more precisely for characters like initial and len - 1
int len = 0;
len = r.allMatches(str).length;
// if (str[ == char) {
// len += 1;
// }
// if (str.lastIndexOf(r) == str.trimRight().length - 1) {
// len += 1;
// }
return len;
}