File tree Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Expand file tree Collapse file tree 1 file changed +14
-17
lines changed Original file line number Diff line number Diff line change 5
5
* 22.July.2013
6
6
*/
7
7
8
- require_once ('VerbalExpressions.php ' );
9
-
8
+ require_once 'VerbalExpressions.php ' ;
10
9
11
10
$ regex = new VerEx ;
12
11
13
12
$ regex ->startOfLine ()
14
- ->then ( "http " )
15
- ->maybe ( "s " )
16
- ->then ( ":// " )
17
- ->maybe ( "www. " )
18
- ->anythingBut ( " " )
19
- ->endOfLine ();
20
-
13
+ ->then ("http " )
14
+ ->maybe ("s " )
15
+ ->then (":// " )
16
+ ->maybe ("www. " )
17
+ ->anythingBut (" " )
18
+ ->endOfLine ();
21
19
22
20
if ($ regex ->test ("http://github.com " ))
23
- echo "valid url " . '<br> ' ;
21
+ echo "valid url " . '<br> ' ;
24
22
else
25
- echo "invalid url " . '<br> ' ;
23
+ echo "invalid url " . '<br> ' ;
26
24
27
25
if (preg_match ($ regex , 'http://github.com ' )) {
28
- echo 'valid url ' ;
26
+ echo 'valid url ' ;
29
27
} else {
30
- echo 'invalud url ' ;
28
+ echo 'invalud url ' ;
31
29
}
32
30
33
31
echo "<pre> " . $ regex ->getRegex () ."</pre> " ;
34
32
35
-
36
- echo $ regex ->clean (array ("modifiers " => "m " ,"replaceLimit " =>4 ))
37
- ->find (' ' )
38
- ->replace ("This is a small test http://somesite.com and some more text. " , "- " );
33
+ echo $ regex ->clean (array ("modifiers " => "m " , "replaceLimit " => 4 ))
34
+ ->find (' ' )
35
+ ->replace ("This is a small test http://somesite.com and some more text. " , "- " );
You can’t perform that action at this time.
0 commit comments