1 a,b:
as a professional software engineer, I know that googling regex syntax and getting it right will take longer than manually writing string comparisons, so... here's all you need to see of my final solution.
int? check3(String line, int index) {
if (line.length < index + 3) {
return null;
}
String sub = line.substring(index, index + 3);
return sub == "one"
? 1
: sub == "two"
? 2
: sub == "six"
? 6
: null;
}