I’m trying to extract specific word in TCL using regex that have below criteria
- Begin with letter “K”
- Second letter is either A or H or N or Z or R
- followed by letters
- followed by dash “-“
- followed by letters
- ending with 2 numbers
set title "reserved for KNBCDEF-ABCD01" set greptitle [regexp -all -inline {mK[AHNZR][A-Za-z]*-[0-9]{2}M} $title] send_user "Matched patterns: greptitlen"
trying above code but gave empty output.
Extracted word from string(s) might be in any below format as long as it matched above criteria
KNBCDEF-ABCD01 or KAXXG-YYUU54 or KRBEF-ZZ654 etc.