Can’t get my code to work. I’ve tried everything I can think of. I’ve double checked my syntax. Heck probably checked 10 times!
var url_video = 'https://www.instagram.com/tv/B7hj-tUhNkt/?igshid=m04ih801dy9n'
var url_pic = 'https://www.instagram.com/p/B7jYI8oll8w/?igshid=11vpf4r072mvh'
let r = new Request(url_pic)
let body = await r.loadString()
Pasteboard.copy(body)
var re = new RegExp("(?<=(<meta property=\"og:image\" content=\"))(.*)(?=\")")
var test = re.test(body)
var match = body.match(re)
// let webview = new WebView()
// await webview.loadURL(url_pic)
console.log(match[0])
Error message
2020-03-01 16:13:54: Error on line 10:20: SyntaxError: Invalid regular expression: invalid group specifier name
I get the same issue. Seems it’s an issue with the javascript engine as mentioned by @Martin_Packer. I figured as much but it’s annoying when some regex will work on some engines and not on others because I can’t tell how to know before hand if it will work or not.
Ended up just doing a string slice with counting the start of the piece of the link i want up to the length of the string. I knew this would work as I have done this before. Thanks for the help.