Last active
August 23, 2018 07:14
-
-
Save KanybekMomukeyev/3b921c31d7923270f5e1f15daeb44f54 to your computer and use it in GitHub Desktop.
regex_ex.dart
This file contains 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
void main() { | |
//на вход идет: +996-552-44-23-88 | |
//на выходе: 996552442388 | |
var phoneNumber = "+996-552-44-23-88"; | |
phoneNumber.replaceAll(new RegExp(r"\d+"), ""); | |
print(phoneNumber); | |
print("test test1 test2".replaceAll(RegExp(r"\s+\b|\b\s"), "")); | |
phoneNumber = phoneNumber.replaceAll('+', '').replaceAll('-', ''); | |
print(phoneNumber); | |
var r = RegExp(r'\d+'); | |
var phone__ = "+996-552-44-23-88"; | |
final s = r.allMatches(phone__).map((match) => match[0]).join(); | |
print(s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment