Skip to content

Instantly share code, notes, and snippets.

@jensblond
Created September 29, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jensblond/6acd6dc2f66ae6236784cd3a3e1f16cb to your computer and use it in GitHub Desktop.
Save jensblond/6acd6dc2f66ae6236784cd3a3e1f16cb to your computer and use it in GitHub Desktop.
parsing.js
function() {
var inputVariable = {{Page URL}},
defaultVal = [],
categories = {{OMF Mapping}};
for (var i = 0, len = categories.length; i < len; i++) {
var regex = new RegExp(categories[i].path);
if (regex.test(inputVariable)) {
return categories[i];
}
}
return defaultVal;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment