Skip to content

Commit 1f2730d

Browse files
committed
Merge pull request #5 from bytehead/master
Some typo and code style fixes
2 parents 38e78ea + 8746a62 commit 1f2730d

File tree

3 files changed

+516
-514
lines changed

3 files changed

+516
-514
lines changed

Example.php

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,31 @@
55
* 22.July.2013
66
*/
77

8-
require_once('VerbalExpressions.php');
8+
require_once 'VerbalExpressions.php';
99

10+
$regex = new \VerbalExpressions\PHPVerbalExpressions\VerbalExpressions();
1011

11-
$regex = new VerEx;
12-
13-
$regex ->startOfLine()
14-
->then( "http" )
15-
->maybe( "s" )
16-
->then( "://" )
17-
->maybe( "www." )
18-
->anythingBut( " " )
19-
->endOfLine();
20-
12+
$regex->startOfLine()
13+
->then("http")
14+
->maybe("s")
15+
->then("://")
16+
->maybe("www.")
17+
->anythingBut(" ")
18+
->endOfLine();
2119

2220
if($regex->test("http://github.com"))
23-
echo "valid url". '<br>';
21+
echo "valid url". '<br>';
2422
else
25-
echo "invalid url". '<br>';
23+
echo "invalid url". '<br>';
2624

2725
if (preg_match($regex, 'http://github.com')) {
28-
echo 'valid url';
26+
echo 'valid url';
2927
} else {
30-
echo 'invalud url';
28+
echo 'invalud url';
3129
}
3230

3331
echo "<pre>". $regex->getRegex() ."</pre>";
3432

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.", "-");

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ VerbalExpressions is a PHP library that helps to construct hard regular expressi
88

99
// some tests
1010

11-
$regex = new VerEx;
11+
$regex = new VerbalExpressions;
1212

1313
$regex ->startOfLine()
14-
->then( "http" )
15-
->maybe( "s" )
16-
->then( "://" )
17-
->maybe( "www." )
18-
->anythingBut( " " )
14+
->then("http")
15+
->maybe("s")
16+
->then("://")
17+
->maybe("www.")
18+
->anythingBut(" ")
1919
->endOfLine();
2020

2121

@@ -35,7 +35,7 @@ echo "<pre>". $regex->getRegex() ."</pre>";
3535

3636

3737

38-
echo $regex ->clean(array("modifiers"=> "m","replaceLimit"=>4))
38+
echo $regex ->clean(array("modifiers" => "m", "replaceLimit" => 4))
3939
->find(' ')
4040
->replace("This is a small test http://somesite.com and some more text.", "-");
4141

0 commit comments

Comments
 (0)