SG
\>
зачем?А предыдущий символ там последняя из трех цифр
Size: a a a
SG
\>
зачем?I
SG
grep '^secret=[:digit:]{3}$' /path/to/file > res.txt
I
grep '^secret=[:digit:]{3}$' /path/to/file > res.txt
I
grep '^secret=[:digit:]{3}$' /path/to/file > res.txt
[[:digit:]]
, a не [:digit:]
SG
[[:digit:]]
, a не [:digit:]
I
SG
-E
после вызова грепаgrep -E '^secret=[0-9]{3}$' /path/to/file > res.txt
PA
SG
I
SG
I
V
I
EN
A
EN
SG
import reВ принципе, да, получилось только сложнее)
textfile = open("/path/to/file")
for string in textfile
result = re.fullmatch("^secret=/d{3}$", string)
print(string) if result == True
EP
import reВ принципе, да, получилось только сложнее)
textfile = open("/path/to/file")
for string in textfile
result = re.fullmatch("^secret=/d{3}$", string)
print(string) if result == True