java - 伊拉克电话号码的java正则表达式
问题描述
我需要一个正则表达式来匹配这个电话号码模式:
- 它总是以 07 开头
- 然后是这个范围内的数字(3-9)
- 它必须是 11 个字符
示例:07902848117
07796938209
07302819248
解决方案
Try this, it should work.
"07[3-9][0-9]{8}"
What this mean is,
07 - it tries to find literally 07
[3-9] - then followed by 3 to 9, only one time
[0-9] - then followed by 0 to 9
{8} - text previous to this should has at least 8 characters.
推荐阅读
- javascript - 反应原生 - siganlR
- functional-programming - 如何在方案(N-queens)中从此函数中删除可变性
- python - 如何将用户的消息分配给 discord.py 中的变量?
- android - 有没有办法在兑换代码文本框android中以编程方式自动填充促销代码
- ruby-on-rails - 推送到 heroku 时出现“预编译资产失败”错误
- javascript - 使用 ajax 导入时如何访问较低级别的变量并连接它们
- discord.js - 从特定消息中删除特定成员的反应
- java - 在 Java 中发送 CSRF 身份验证 - Pusher
- r - 在 R 中绑定多个 csv 以输出到 ggplot2 中的图形
- authentication - 使用 GraphQL/HotChocolate 验证登录令牌