Skip to content

Instantly share code, notes, and snippets.

@brianfoshee
Last active October 3, 2015 18:08
Show Gist options
  • Save brianfoshee/2500953 to your computer and use it in GitHub Desktop.
Save brianfoshee/2500953 to your computer and use it in GitHub Desktop.
Regular Expression to match Apple Provisioning Profile strings
## This regular expression will match strings in the form of an Apple Provisioning Profile (iOS, at least)
## Example: A0D25BDA-BX3F-6AD1-BC65-6DC9G0S13BAK
## Simplified a bit from the first version of the gist.
str = "some string with A0D25BDA-BX3F-6AD1-BC65-6DC9G0S13BAK that in the middle of it"
new_str = str.sub(/[[A-Z\d]{4,12}-]{1,36}/,new_profile_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment