When second parameter of a matches is a bad regex use it as string instead

Currently if the second bubble in a matches block is a bad regular expression (like “hello)”), it stops the project. This is useful for people who know why it does that, but for people who don’t (the majority of users) it doesn’t make any sense. It would make more sense if instead of breaking the project, it just checks if the exact string in the second bubble is in the first.

18 Likes

I can agree. When I first started using regex in in Siri Shortcuts I was confused about the errors.

7 Likes

I was going to point that out and I totally agree with that.

The more experienced users would also benefit just using a regex editor like regex101.com

6 Likes

This would be great. Or, what if Hopscotch just highlighted the block with an exclamation mark beside the wrongly formatted block and gave some kind of notification in the editor? Something like a red text above the object saying “1 error” or something similar.

4 Likes

Since this is matching a regular expression, I’d expect a lot of people trying it to not know what that even is, and having an error that says “invalid expression” would really confuse them. I still think it would be better to treat it as a string if it isn’t a valid regular expression.

5 Likes

Hopscotch officially has syntax errors now… wasn’t that their key selling point?

5 Likes

Not having syntax errors is almost weird and annoying. Not having an output is also annoying.

9 Likes

So u like syntax errors?

2 Likes

Better than nothing, right? :rofl:

No…

1 Like

It’s very useful if you know why you’re getting it. It’s just already caused confusion with people who don’t know that the second bubble is a regular expression.

3 Likes

Very true.

It did for me that’s for sure