mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 22:09:06 +00:00
Now that the context menu code is on stable, move the sample out of experimental. Fixes https://github.com/flutter/samples/issues/2110 ## Pre-launch Checklist - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I read the [Contributors Guide]. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] All existing and new tests are passing. --------- Co-authored-by: Brett Morgan <brett.morgan@gmail.com>
11 lines
254 B
Dart
11 lines
254 B
Dart
/// Returns true if the given String is a valid email address.
|
|
bool isValidEmail(String text) {
|
|
return RegExp(
|
|
r'(?<name>[a-zA-Z0-9]+)'
|
|
r'@'
|
|
r'(?<domain>[a-zA-Z0-9]+)'
|
|
r'\.'
|
|
r'(?<topLevelDomain>[a-zA-Z0-9]+)',
|
|
).hasMatch(text);
|
|
}
|