Last active
February 9, 2019 12:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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