Skip to content

Instantly share code, notes, and snippets.

@htammen
Forked from anonymous/index.html
Created October 11, 2017 18:01
Show Gist options
  • Save htammen/e79b3bc4a68f52af86c30b9d143c9566 to your computer and use it in GitHub Desktop.
Save htammen/e79b3bc4a68f52af86c30b9d143c9566 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