正则疑义
正则疑问
ereg("^a{2,}$","aaasssaaa")
为什么返回false
------解决方案--------------------
建议用 preg_match 这个比ereg 的效率高些。
------解决方案--------------------
汗~~~看错了。
但是你的规则是要求两个以上连续的a,从开头到结束
但是你的字符串中间有其他字符
------解决方案--------------------
ereg("^a{2,}","aaasssaaa")
^a{2,}$ 表示匹配两个及以上由 a 组成的串,而你的 aaasssaaa 不是,里面有字符 s
------解决方案--------------------
------解决方案--------------------
- PHP code
$a = ereg("^a{2,}.*a{2,}$","aaasssaaa");var_dump($a);<div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Note that match is used for matching operations, and its return value is of boolean type. Through match, you can simply verify whether a certain element exists in the list. Example // Verify whether there is a string in the list starting with a, and match the first one, that is, return truebooleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out .println(anyStartsWithA);//true//Verify whether the string in the list

The project recently added an IP black and white list function. I found that if the IP filtering interceptor returns false, the front end will display cross-domain. After trying to modify the MVC configuration class, I found that it still didn't work. Finally, I added a judgment to the interceptor @OverridepublicbooleanpreHandle. (HttpServletRequestrequest,HttpServletResponseresponse,Objecthandler)throwsIOException{//-----------Just add this-----------if(!(handlerinstanceo

Concept 1. Various Match operations can be used to determine whether a given Predicate meets the elements of a Stream. 2. Match operation is a terminal operation and returns a Boolean value. Instance booleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out.println(anyStartsWithA);//truebooleanallStartsWithA=stringCollection.stream().

Concept 1. Various Match operations can be used to determine whether a given Predicate meets the elements of a Stream. 2. Match operation is a terminal operation and returns a Boolean value. Instance booleananyStartsWithA=stringCollection.stream().anyMatch((s)->s.startsWith("a"));System.out.println(anyStartsWithA);//truebooleanallStartsWithA=stringCollection.stream().

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。

图片消失如何解决先是图片文件上传$file=$_FILES['userfile']; if(is_uploaded_file($file['tmp_name'])){$query=mysql_query("INSERT INTO gdb_banner(image_src ) VALUES ('images/{$file['name'
