getKeywords method #109

nijikokun opened this Issue Mar 12, 2013 · 0 comments


None yet
1 participant
Rainbow.getKeywords = function(str) {
  str = str.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '|');
  return '\\b(?:' + str + ')\\b';

Would be nice to have in the official file for things like:

Rainbow.getKeywords('break case catch class copy const __finally __exception __try');

would return


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment