When I combine them in an if else, the first one (the if statement) always fails with the correct pattern (123-R-20210128-9999) on the clipboard. The second one works with 123456789 on my clipboard. I'm assuming since the second one is looking for nine digits it is somehow interfering with the last portion of the regex statement in the if statement → \d+$
I'm going to add a MsgBox if the clipboard does not contain either value but cannot get this portion to work. Thanks!
Code: Select all
if (regexmatch(Clipboard, "^\d{3}-[A-Z]{1}-\d{8}-\d+$"))
{
gcnum := Clipboard
type := "Title"
}
else (regexmatch(Clipboard, "^\d{9}$"))
{
gcnum := Clipboard
type := "SSN"
}
url := "https://mysite.com/_api/Web/Lists/GetByTitle('This Title')/items?$select=id,Title,Name,Facility,NewColumn1,Urgent_x003f_&$expand=Facility/Full_x0020_Facility&$filter=Facility/Full_x0020_Facility ne '' and startswith(" . type . ", '" . gcnum . "')"