@@ -11,7 +11,7 @@ class Regex
11
11
const PATTERN_ALPHA = '\pL\pM ' ;
12
12
const PATTERN_ALPHANUMERIC = '\pL\pM\pN ' ;
13
13
const PATTERN_ALPHADASH = '\pL\pM\pN._- ' ;
14
- const PATTERN_INTEGER = '\pN ' ;
14
+ const PATTERN_DIGITS = '0-9 ' ;
15
15
const PATTERN_NUMERIC = '-?\d*(\.\d+)? ' ;
16
16
17
17
/**
@@ -57,9 +57,9 @@ public static function alphanumeric($subject, $replace = '')
57
57
* @param string $replace
58
58
* @return array|string|string[]|null
59
59
*/
60
- public static function integer ($ subject , $ replace = '' )
60
+ public static function digits ($ subject , $ replace = '' )
61
61
{
62
- return static ::replace ($ subject , self ::PATTERN_INTEGER , $ replace );
62
+ return static ::replace ($ subject , self ::PATTERN_DIGITS , $ replace );
63
63
}
64
64
65
65
/**
@@ -128,9 +128,9 @@ public static function isAlphanumeric($subject, bool $allowWhitespace = false)
128
128
* @param bool $allowWhitespace
129
129
* @return bool
130
130
*/
131
- public static function isInteger ($ subject , bool $ allowWhitespace = false )
131
+ public static function isDigits ($ subject , bool $ allowWhitespace = false )
132
132
{
133
- return static ::match ($ subject , self ::PATTERN_INTEGER , $ allowWhitespace );
133
+ return static ::match ($ subject , self ::PATTERN_DIGITS , $ allowWhitespace );
134
134
}
135
135
136
136
/**
0 commit comments