Last active
April 26, 2016 18:49
-
-
Save CraigCav/393d1b2f36f468bf5932408a2579b688 to your computer and use it in GitHub Desktop.
salesforce namespace regex
This file contains hidden or 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
var nameFormat = /^(\w+__)?([A-Za-z0-9]+(?:_?[A-Za-z0-9]+)+)*(__+.)?$/; | |
var [match, namespace, name, suffix] = nameFormat.exec('NS1__Foo__c'); | |
console.log(namespace); // logs: "NS1__" | |
console.log(name); // logs: "Foo" | |
console.log(suffix); // logs: "__c" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment