Any regex wizards here ? I am struggling to parse

$ grep 'dsk[^\.]*\.1' file.txt

It appears to bind to the 'dsk element' and matches

MIB::dskIndex.1 = INTEGER: 8

but not

MIB::dskIndex.8 = INTEGER: 1

My limited regex brain reads this as:- 'dsk' followed by Not a single character repeated many times and then '.1'.


@andyc [^\.]* means: any number of characters that are not a backslash or a dot (backslash in square brackets is different from outside.)

Sign in to participate in the conversation

Nunja... äh... Kekse, Animu usw.