Reputation: 2413
I am trying to compare a String with another one which contains a regex in Handlebars, and I am wondering if is there any meta character I can use to represent any String.
In other words, I want that the word "Resource" in the following snippet can be anything:
{{#if_eq blockReason compare="Unable to open [Resource]" }}
...do stuff...
{{/if_eq}}
Thanks in advance people!
Upvotes: 0
Views: 912
Reputation: 2834
something that can represent any character would be this: [\s\S]
This will match any character including newlines. If you want any character without newlines .
will work just fine.
If you want to match a number of these character you can do this: [\s\S]+
Upvotes: 2