Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <h1>Parse Phone Numbers from any Copy / Pasted Text</h1>
<div style="float:left; padding: 10px; margin: 10px">
  <h3>Paste Text Here</h3>
  <button>Parse Phone Numbers</button><br>
<textarea rows="20" cols="40">This could be a document with some (801) 360-5555 and +17578805555 and 1.385.722.5555 or any type of US/Canada phone number format that uses characters such as space, comma, dash, or parens as separators it won't catch non phone numbers like 222-44-5555 or +1-222-999-99999 or (703) 32-32-888 or +123456789011</textarea>
<div style="float: left; padding: 10px; margin: 10px">
  <h3>See Parsed Numbers Here</h3>




                function log(thing) {
  $('code').append(thing + '\n');

function doWork() {
  var reg = /(?=^|\D)(\+?1)?\s*[\-\.]?\s*\(?\s*(\d{3})\s*\)?\s*[\-\.]?\s*(\d{3})\s*[\-\.]?\s*(\d{4})(?=\D|$)/g
    , result
    , text = $('textarea').val()
    , numbers = []
    , numbersMap = {}
    , phone
  while ((result = reg.exec(text)) !== null) {
    phone = '(' + result[2] + ') ' + result[3] + '-' + result[4];
    if (!numbersMap[phone]) {
      numbersMap[phone] = true;

  log('total numbers found:' + numbers.length);
  numbers.sort().forEach(function (number) {


$('body').on('click', 'button', function () {