Query regarding pattern match

Hi

Could someone explain to me as to why would the pattern match of [:digit:] match characters and print s2 in the link given below ?

http://try.bro.org/#/trybro/saved/d1c1dbb4-0148-4097-8967-0a5d2e796d69

Just in case the above link changes as I work on new exercise I have uploaded a screenshot as well.

Hello,

Bro regular expressions does not support this kind of character classes. As far as I know it only supports listing all letters you want to include, negation or ranges. The line matches because the letter t is included in :digit: as well as s2.

Johanna

Thanks for explaining.

I got a bit confused by the Subexercise Part 2 example on the link https://www.bro.org/current/exercises/prog-primer/part1.bro Now I understand that we cannot use such character classes.

Actually I was wrong - the example you cited explains it correctly. You need to use double parentheses with the character classes - if you use [[:digit:]] it works perfectly.

Johanna