1
0
Fork 0

Add more possessive quantifiers

pull/9601/head
Jordi Boggiano 2021-01-12 14:05:55 +01:00 committed by GitHub
parent b021647e6f
commit 492f8cb350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,12 +20,12 @@ use Composer\Repository\PlatformRepository;
class JsonManipulator class JsonManipulator
{ {
private static $DEFINES = '(?(DEFINE) private static $DEFINES = '(?(DEFINE)
(?<number> -? (?= [1-9]|0(?!\d) ) \d++ (\.\d++)? ([eE] [+-]? \d++)? ) (?<number> -? (?= [1-9]|0(?!\d) ) \d++ (\.\d++)? ([eE] [+-]?+ \d++)? )
(?<boolean> true | false | null ) (?<boolean> true | false | null )
(?<string> " ([^"\\\\]*+ | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9A-Fa-f]{4} )* " ) (?<string> " ([^"\\\\]*+ | \\\\ ["\\\\bfnrt\/] | \\\\ u [0-9A-Fa-f]{4} )* " )
(?<array> \[ (?: (?&json) \s*+ (?: , (?&json) \s*+ )*+ )? \s*+ \] ) (?<array> \[ (?: (?&json) \s*+ (?: , (?&json) \s*+ )*+ )?+ \s*+ \] )
(?<pair> \s*+ (?&string) \s*+ : (?&json) \s*+ ) (?<pair> \s*+ (?&string) \s*+ : (?&json) \s*+ )
(?<object> \{ (?: (?&pair) (?: , (?&pair) )*+ )? \s*+ \} ) (?<object> \{ (?: (?&pair) (?: , (?&pair) )*+ )?+ \s*+ \} )
(?<json> \s*+ (?: (?&number) | (?&boolean) | (?&string) | (?&array) | (?&object) ) ) (?<json> \s*+ (?: (?&number) | (?&boolean) | (?&string) | (?&array) | (?&object) ) )
)'; )';