How to randomly assign any Real Device by using regular expression?

How to randomly assign any Real Device by using regular expression?

Hi Macy,

You can use the following regular expression to assign any Real Device randomly:

  • "." - any character being repeated “n” times. Ex (“iPhone.*”) will fetch you any iPhone device from our inventory.

  • Comma separated - If multiple devices regex is passed, they will be defined as comma-separated values. Example - (“Pixel.","Galaxy S.”) will fetch you any Pixel or Galaxy S model device.

  • “[]” - Special characters in the device name, such as “Galaxy Note 10+” will be handled in the regex by using square brackets. Example “Galaxy Note 10[+]” will fetch you a Galaxy Note 10+ device.

  • “[]” - Multiple values passed using only a single character. Example “Pixel [3456]” will fetch you any of Pixel 3, Pixel 3a, Pixel 4, Pixel 5, Pixel 6, or Pixel 6 Pro.

  • “$” - If the user passes multiple values (commas separated), $ will end the substring. For example - “Pixel 6$” will fetch only the Pixel 6 devices. “Pixel [36]$” will fetch only between Pixel 3 and Pixel 6