Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在“php”中创建一个正则表达式,它检查一个字符串是否由数字“:”““”,“\回车”组成。我知道这很简单,但我在这个领域有点绿。提前致谢 。
不能只用PHP的is_numeric()方法吗?
is_numeric()
在 PHP 文档中查看 is_numeric
您可以使用
/^(?=.*\d)(?=.* )(?=.*:)(?=.*,)(?=.*\r)[: \d,\r]+$/
^是字符串的开头
^
.匹配任何单个字符
.
.*匹配 0 到多个字符 ( .)
.*
(?=.*\d)是一个前瞻,只有当它有一个数字时才会进一步匹配..
(?=.*\d)
[abcd]是一个匹配 a OR b OR c OR d 的字符类
[abcd]
$是字符串的结尾
$
我想把一张桌子放在一张桌子里面,让它跨越整个东西高度的 100%,如果这有意义的话。
<table width="800" border="2"> <tr> <td width="66%"> box 1 </td> <td width="10" rowspan="2" /> <td ro