Using Regex formula for device detection in WooCommerce orders before export

Hey @Anze , interesting case and good question!

So first of all I would say there is an easier option to do this: Create a new sheet or new tab and use the IMPORTRANGE() or the QUERY() function. This will import the data and you should be able to filter without messing up the formula.

RegEx in make

However since Make provides you with great power and more extensibility it would also be a good idea to use this. You can use a regex match pattern module to extract all information.

^(?<browser1>.+?) \((?<os>.+?)\)(?: (?<engine>\S+(?: \(.+?\))?)(?: Version\/(?<version>\S+(?: Mobile\/\S+)?))?(?: (?<browser2>\S+))?(?: \S+? (?<browser4>\S+\/\S+$))?)?


You can test and check the groups of this specific pattern in Regex101 for debugging and learning:

More information to learn about regex you can find here as well:

2 Likes