REGEX - 允许数字和 .-/ [英] REGEX - Allow Numbers and . - /

查看:35
本文介绍了REGEX - 允许数字和 .-/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个正则表达式来只允许数字和 (.-/)

I need a regular expression to allow just numeric and (.-/)

它应该允许这样的事情:

It should allow something like that:

011.235673.98923/0001-12

推荐答案

您正在寻找的模式,仅匹配那些带有数字、.、- 和/的字符串:

The pattern you're looking for, that matches only those strings with numbers, ., -, and /:

^[0-9\.\-\/]+$

如果您有一种特定的语言想要实现这一点,我可以帮助您.

If you have a specific language you're looking to implement this I may be able to help you.

这篇关于REGEX - 允许数字和 .-/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆