This repository was archived by the owner on Dec 5, 2019. It is now read-only.
Use strpos (much faster than preg_match) to determine if a char is a white space#327
Open
mlocati wants to merge 1 commit intooyejorge:masterfrom
mlocati:faster-isWhitespace
Open
Use strpos (much faster than preg_match) to determine if a char is a white space#327mlocati wants to merge 1 commit intooyejorge:masterfrom mlocati:faster-isWhitespace
mlocati wants to merge 1 commit intooyejorge:masterfrom
mlocati:faster-isWhitespace
Conversation
…white space White space characters are defined by the PCRELib as: - LF (dec 10 = hex \x0a = char "\n") - HT (dec 9 = hex \x09 = char "\t") - VT (dec 11 = hex \x0b = char "\v") - FF (dec 12 = hex \x0c = char "\f") - CR (dec 13 = hex \x0d = char "\r") - space (dec 32 = hex \x20 = char " ") Reference: https://github.com/php/php-src/blob/master/ext/pcre/pcrelib/doc/pcre.txt#L5203-L5204
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What about using
strposinstead of the slowerpreg_match?White space characters are defined by the PCRELib as: