Leser: 15
TFId=(\d+\W)*
1 2 3 4 5 6 7 8 9 10 11
$ perl -E'(/(TFId=(?:,?(?:\d+|nil))*)/ && say "yes") || say "no" while <> ' TFId=1 yes TFid=, no TFId=1, yes TFId=1,,,2 yes TFId=nilnilnil yes
1
2
3
4
5
6
7
8
9
10
11
perl -e'(print "capture: ".($_=~/(TFId=(?:,?(?:\d+|nil))*)/)[0]."\n") while <>'
TFId=1
capture: TFId=1
TFId=,
capture: TFId=
TFId=1,
capture: TFId=1
TFId=1,,,2
capture: TFId=1
TFId=nilnilnil
capture: TFId=nilnilnil