Skip to content

Commit b340925

Browse files
committed
merging @coei86 something and somethingBut from original VerbalExpressions repo
1 parent 40aed4e commit b340925

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

VerbalExpressions.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ function anythingBut( $value ) {
119119
$this->add("([^". $this->sanitize($value) ."]*)");
120120
return $this;
121121
}
122+
123+
/**
124+
* Accept any non-empty string
125+
*/
126+
function something() {
127+
$this->add("(.+)");
128+
return $this;
129+
}
130+
131+
/**
132+
* Anything non-empty except for these chars
133+
* @param string $value The unaccepted chars
134+
*/
135+
function somethingBut( $value ) {
136+
$this->add("([^". $this->sanitize($value) ."]+)");
137+
return $this;
138+
}
139+
122140
/**
123141
* Shorthand for preg_replace()
124142
* @param string $source the string that will be affected(subject)

0 commit comments

Comments
 (0)