Skip to content

Replaced regexp lookahead with two regular expressions#2

Open
romanoff wants to merge 2 commits intopomack:masterfrom
romanoff:master
Open

Replaced regexp lookahead with two regular expressions#2
romanoff wants to merge 2 commits intopomack:masterfrom
romanoff:master

Conversation

@romanoff
Copy link
Copy Markdown

Idea is that I replaced
"^(?!-_(?:expression|(?:moz-)?binding))(?:[.#]?-?(?:[_a-z0-9-]+)(?:-[a-z0-9-]+)-?|-?(?:[0-9]+(?:.[0-9]*)?|.[0-9]+)(?:[a-z]{1,2}|%)?|!important|)\z/i"

regexp with:

"^(-_(?:expression|(?:moz-)?binding))/i" (it should not match)
"(?:[.#]?-?(?:[_a-z0-9-]+)(?:-[a-z0-9-]+)-?|-?(?:[0-9]+(?:.[0-9]*)?|.[0-9]+)(?:[a-z]{1,2}|%)?|!important|)\z/i" (it should match).

Probably it's good idea to look on second commit only. As first one is just "go fmt". Tests pass now.

@pomack
Copy link
Copy Markdown
Owner

pomack commented Feb 25, 2013

Cool, I can't really look at this for a couple weeks, but will definitely want this merged. I couldn't quite understand what the regexp was doing to re-write it. The regexp was taken from the Java code.

@romanoff
Copy link
Copy Markdown
Author

No problem. I will wait :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants