Skip to content

Instantly share code, notes, and snippets.

@h3xxx
Last active December 22, 2015 12:55
Show Gist options
  • Save h3xxx/7c4caabb51bfb7342bc9 to your computer and use it in GitHub Desktop.
Save h3xxx/7c4caabb51bfb7342bc9 to your computer and use it in GitHub Desktop.
My RegExps [builder: http://regexr.com/]

RegExp for searching multiple method execution in one line of code.

RegExp:

/(.([a-zA-Z]+\(["'][a-zA-Z-]+["']\))){2,}/g

Test values:

  Obj.prop.methodX("val").methodY("val");
  this.get("someClass").addClass("full");
  Obj.prop.addClass('some-class').removeClass('hidden');
  Obj.prop.addClass('some-class');

Result: Should find all like

.methodX("val").methodY("val")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment