0

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!

stack man
  • 1,863
  • 7
  • 26
  • 52
  • 1
    possible duplicate of [Reference - What does this regex mean?](http://stackoverflow.com/questions/22937618/reference-what-does-this-regex-mean) – Kristján Aug 13 '15 at 14:55

1 Answers1

2

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]+

d0nut
  • 2,841
  • 1
  • 16
  • 23
  • I am using {{#if_eq blockReason compare="Unable to acquire lock, already locked by [\s\S]+" }} and it's not working unfortunately... – stack man Aug 13 '15 at 14:53
  • @stackpepe could you give us more detail in what you're trying to do? – d0nut Aug 13 '15 at 14:56