Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Clear&Readable solution in Clear category for [old] Find Quotes by SaintDron
"use strict";
const findQuotes = (a) => a.match(/(?<=")(\w[^"]+)?(?=")/g) || [];
var assert = require('assert');
if (!global.is_checking) {
console.log('Example:');
console.log(findQuotes('"Greetings"'));
// These "asserts" are used for self-checking and not for an auto-testing
assert.deepEqual(findQuotes('"Greetings"'), ['Greetings']);
assert.deepEqual(findQuotes('Hi'), []);
assert.deepEqual(findQuotes('good morning mister "superman"'), ['superman']);
assert.deepEqual(findQuotes('"this" doesn\'t make any "sense"'), ['this', 'sense']);
assert.deepEqual(findQuotes('count empty quotes ""'), ['']);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
}
Feb. 16, 2019
Comments: