Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Util.stringToObject RegExp Error #17

Open
daybrush opened this issue Dec 6, 2016 · 0 comments
Open

Util.stringToObject RegExp Error #17

daybrush opened this issue Dec 6, 2016 · 0 comments
Labels

Comments

@daybrush
Copy link
Member

daybrush commented Dec 6, 2016

1. /\S*([\s\S]*)|\S+/g

  • PASS "1px solid rgba(10, 10, 10, 1)"
    => ["1px", "solid", "rgba(10, 10, 10, 1)"]
  • FAIL "rgba(10, 10, 10, 0.5) rgba(10, 10, 10, 1) test 10"
    => Expected ["rgba(10, 10, 10, 0.5)", "rgba(10, 10, 10,1)", "test", "10"]
    => Result ["rgba(10, 10, 10, 0.5) rgba(10, 10, 10 1)", "test", "10"]

text in one or more parentheses => error

2./(\S*([^\)])|(\S+(\s,\s*))|\S+)+/g

  • PASS "1px solid rgba(10, 10, 10, 1)"
    => ["1px", "solid", "rgba(10, 10, 10, 1)"]

  • PASS "rgba(10, 10, 10, 0.5) rgba(10, 10, 10, 1) test 10"
    => ["rgba(10, 10, 10, 0.5)", "rgba(10, 10, 10,1)", "test", "10"]

  • FAIL "gradient(rgba(10, 10, 10, 0.5) rgba(10, 10, 10, 1) test 10)"
    => Expected ["gradient(rgba(10, 10, 10, 0.5) rgba(10, 10, 10, 1) test 10)"]
    => Result ["gradient(rgba(10, 10, 10, 0.5)", "rgba(10, 10, 10, 1) test 10)"]

parentheses in parentheses => error

PASS 3. /(\S*(((([^\)])|[^\)\(])))|(\S+(\s,\s*))|\S+)+/g

@daybrush daybrush added the bug label Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant