Skip to content

Instantly share code, notes, and snippets.

@DaemonLoki
Last active February 9, 2019 12:46
String mailPattern = r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$";
RegExp regEx = RegExp(mailPattern);
String mailAddress = "Couldn't find any mail in the foto! Please try again!";
for (TextBlock block in visionText.blocks) {
for (TextLine line in block.lines) {
if (regEx.hasMatch(line.text)) {
mailAddress = line.text;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment