Skip to main content
Ben Nadel at Ellen's Stardust Diner (New York City) with: Colin Silverberg and Carol Loffelmann and Daniel Silverberg
Ben Nadel at Ellen's Stardust Diner (New York City) with: Colin Silverberg , Carol Loffelmann ( @Mommy_md ) , and Daniel Silverberg

Arthur

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, [].unique.call(regex.flags+'gi').join('')); console.log(regex, clone); ```... read more »