Last active
July 21, 2020 10:22
-
-
Save benoitjadinon/8c5dcb1891570d28a849d1d81a66eb70 to your computer and use it in GitHub Desktop.
filterin'
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
void main() { | |
final pairs = [ | |
'BTC/USDT', | |
'BTCD/USDT', | |
'BTC/USD', | |
'USDT/BTC', | |
]; | |
final search = 'BTCUS'; | |
final r = search.replaceAll(' ', '').split('').join('.*?'); | |
final regexp = RegExp(r); | |
final res = pairs.where(regexp.hasMatch).toList(growable: false); | |
print(res.join('\n')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment