Search code examples
regexlanguage-packs

regex: Match atleast one character between two other characters


I currently use a regex

\\\[(.*)\\\]

so if I would try to match [] it will work. But what I want is so it requires at a minimum one character between [ and ] to match my regex, but how?

Thanks!


Solution

  • Before matching (.*). Do a match on [^]] to match something other than the closing ].