Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.


Member since May 5, 2016

Recent Blog Comments By Arthur

  • Cloning RegExp (Regular Expression) Objects In JavaScript

    Posted on May 5, 2016 at 8:10 PM

    Cloning the regular expressions in JavaScript: ``` var regex=/.*/g, clone; // Easy way clone=RegExp(regex.source,regex.flags); // Additional way to add/replace flags clone=RegExp(regex.source, []'gi').join('')); console.log(regex, clone); ```... read more »