Hi folks
I am trying to validate whether a text string contains a very specific combination of words and characters.
After some hours of trying to get homeyscript to do the pattern matching using regex I am about to give up.
I have reduced my string pattern to the absolute simple variant seen below (just “Disallow:”) - and still the homeyscript returns false.
Demo variable = User-agent: * Disallow: / # Host Host: https://website.dk # Sitemaps Sitemap: https://website.dk/sitemap.xml
Homeyscript
const regex = /Disallow:/;
// Test the input string against the regular expression
return regex.test(console.log(args[0]));
If Homey/homeyscript does not support regex pattern matching, which kinds of pattern matching methods can I use instead?