I am trying to pull the number from a string per the CSS format as follows:
str == \"50.1px\"
sz = str.match(/+([0-9]|\\.)/)
It complains about the + expression unless I escape it, but then then sz is null. If I remove the + it returns only the first digit. I\’m completely stumped.





Rating:
The post regex – javascript regexp, can't get + expression to work appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/regex-javascript-regexp-cant-get-expression-to-work.html
No comments:
Post a Comment