Last active
September 22, 2016 17:16
-
-
Save cwardzala/5581706a2e0600526ed88fd57f184d0f to your computer and use it in GitHub Desktop.
Parsing CloudSearch range facets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const csRangeParse = (value) => { | |
return value.replace(/(\[|\]|\})/g, '').trim().split(','); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function csRangeParse ($value) { | |
return explode(preg_replace("/(\\[|\\]|\\})/", '', $value), ','); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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