Created
April 25, 2014 04:54
-
-
Save anonymous/11278042 to your computer and use it in GitHub Desktop.
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
/(\bcss3|svg\b)+|https?:\/\/(www\.)?\w+\.\w+\/(\-css3|svg\-)/ig |
var reg = new RegExp(/(\bcss3|svg\b)+|https?:\/\/(www.)?\w+.\w+\/(-css3|svg-)/ig);
Regular Expressions don't get quoted when you're passing it into RegExp
Oops! Awesome you're amazing!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var reg = new RegExp("/(\bcss3|svg\b)+|https?://(www.)?\w+.\w+\/(-css3|svg-)/ig");
reg.test("I love this thing about SVG. http://foo.com/article"); // returns false, should return true
reg.test("This is awesome http://super-awesome-svg.com"); // returns false, should return true
reg.test("I <3 this css3 button thing http://codepen.com/abcdefg"); // returns false, should return true
reg.test("This is a thing we are testing. It should not match this http://t.co/ifesVgief"); // returns false
reg.test("Boogy buggy booger. It should not match this http://t.co/ewfijCSs3few"); // returns false