Skip to content

Instantly share code, notes, and snippets.

Created October 11, 2017 17:58
Show Gist options
  • Save anonymous/539b7f3fd6ae901eeaf001b826bc9c65 to your computer and use it in GitHub Desktop.
Save anonymous/539b7f3fd6ae901eeaf001b826bc9c65 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/werowizafe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
let oBindingPath = "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')";
// the binding path is something like this: "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')"
let rBindingPath = /^\/\w+\(Zcontrnbr='(\w+)',Zcondlfd='(\w+)'\)/g;
let match = rBindingPath.exec(oBindingPath);
if(match) {
let zcontrnbr = match[1];
let zcondfld = match[2];
console.log(zcontrnbr);
console.log(zcondfld);
} else {
console.log("No match found")
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">let oBindingPath = "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')";
// the binding path is something like this: "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')"
let rBindingPath = /^\/\w+\(Zcontrnbr='(\w+)',Zcondlfd='(\w+)'\)/g;
let match = rBindingPath.exec(oBindingPath);
if(match) {
let zcontrnbr = match[1];
let zcondfld = match[2];
console.log(zcontrnbr);
console.log(zcondfld);
} else {
console.log("No match found")
}
</script></body>
</html>
let oBindingPath = "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')";
// the binding path is something like this: "/ZLCT_CONTRACT_LISTSet(Zcontrnbr='AR00000031',Zcondlfd='0001')"
let rBindingPath = /^\/\w+\(Zcontrnbr='(\w+)',Zcondlfd='(\w+)'\)/g;
let match = rBindingPath.exec(oBindingPath);
if(match) {
let zcontrnbr = match[1];
let zcondfld = match[2];
console.log(zcontrnbr);
console.log(zcondfld);
} else {
console.log("No match found")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment