I am using an onHandler set from the web companion to get the value for a button - and it returns "window.open("https://url/link.asp?sku=123-4567-ABC890&version=Z28");". I really only want to see the SKU value returned. Is there a way I can do this with Tealium?
In the jQuery onHandler extension, select "JS Code" from the drop down when setting your data source, and do something like this:
To explain each part of the expression in detail:
This bit is a regular expression that will match the SKU value:
... but we want only the captured SKU, so we need to address the second part of the match array (index 1), hence:
(/(?:sku\=)(.*)(?:&)/) //  will return the 2nd match from the regex
...will return the URL of the item you clicked on, which I'm assuming is where the string you posted originally came from.
I hope this helps - it's a bit tricky to explain without getting too verbose. Let me know if you have any questions!
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.