Skip to content

Instantly share code, notes, and snippets.

@cwardzala
Last active September 22, 2016 17:16
Show Gist options
  • Save cwardzala/5581706a2e0600526ed88fd57f184d0f to your computer and use it in GitHub Desktop.
Save cwardzala/5581706a2e0600526ed88fd57f184d0f to your computer and use it in GitHub Desktop.
Parsing CloudSearch range facets
const csRangeParse = (value) => {
return value.replace(/(\[|\]|\})/g, '').trim().split(',');
};
<?php
function csRangeParse ($value) {
return explode(preg_replace("/(\\[|\\]|\\})/", '', $value), ',');
}
import re
def csRangeParse (value):
return re.sub(ur'(\[|\]|\})', '', value).split(',')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment