Query regarding pattern match


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


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


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.


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.