栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Flutter Dart:如何使用RegEx从字符串中提取数字

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Flutter Dart:如何使用RegEx从字符串中提取数字

const text = '''Lorem Ipsum is simply dummy text of the 123.456 printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an 12:30 unknown printer took a galley of type and scrambled it to make a23.4567type specimen book. It has 445566 survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.''';final intRegex = RegExp(r's+(d+)s+', multiLine: true);final doubleRegex = RegExp(r's+(d+.d+)s+', multiLine: true);final timeRegex = RegExp(r's+(d{1,2}:d{2})s+', multiLine: true);void main() {  print(intRegex.allMatches(text).map((m) => m.group(0)));  print(doubleRegex.allMatches(text).map((m) => m.group(0)));  print(timeRegex.allMatches(text).map((m) => m.group(0)));}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/427761.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号