Skip to content

Instantly share code, notes, and snippets.

View MarQuisKnox's full-sized avatar

MarQuis Knox MarQuisKnox

View GitHub Profile
@MarQuisKnox
MarQuisKnox / isValidArray.js
Created December 20, 2016 17:41
Check If a String is a Valid Array
/**
* Determine if a string
* is a valid array
*
* @param string string
* @return boolean
*/
function isValidArray( string )
{
var pattern = /^\[('|")?[A-Za-z0-9]+('|")?(((,(\s+)?('|")?[A-Za-z0-9]+('|")?)+)?)\]$/ig;