Regex to get the value from brackets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 06:57 AM
Hello Team,
We have different values in one of the reference fields in particular table like below
12345(Aukland)
098765(namibia)
We need help to filter the values in the brackets only with the help of regex like below by removing all the values other than values in brackets
Aukland
Namibia
Post that we need to verify above values will be avialable in particuler table or not
Can anyone help on this
thanks,
nagesh
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 11:52 PM
excellent How to copy these values in glide list with comma seperated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 07:31 AM
var arrResult = [];
for(var i in txtArr){
var str = txtArr[i];
arrResult.push(str.substring(str.indexOf('(') + 1, str.lastIndexOf(')')));
}
g_form.setValue("list_field",arrResult.toString());// client side
OR
current.setvalue("list_field",arrResult.toString());// server side
I just have one doubt, if it is glidelist and you are fetching locations, then you will need to glide the cmn_location table, and get the list and use above function to populate.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 03:23 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2022 11:50 AM
this is slightly more succinct than the other answers.
var input ='12345(Aukland),098765(namibia),098765(botswana),098765(quebec),098765(new york),098765(toronto),098765(kiev),098765(tokyo),098765(mumbai).'
input.match(/\(([^)]+)\)/g).map(function(m){return m.replace(/[()]/g,'')});
/*
[
"Aukland",
"namibia",
"botswana",
"quebec",
"new york",
"toronto",
"kiev",
"tokyo",
"mumbai"
]
*/