Skip to content

Instantly share code, notes, and snippets.

@brianyang
Created February 3, 2012 14:51
Show Gist options
  • Save brianyang/1730522 to your computer and use it in GitHub Desktop.
Save brianyang/1730522 to your computer and use it in GitHub Desktop.
regular expression with variable
var regExpVar = function() {
var catVar = "Category:.*"
var catPat = new RegExp(catVar, "g")
var genCatArr = dataBlock.match(catPat)
return this
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment