I'm working with regular expression on python then I've the followings string that I need to parse some like
XCT_GRUPO_INVESTIGACION_F1.sql
XCT_GRUPO_INVESTIGACION_F2.sql
XCT_GRUPO_INVESTIGACION.sql
XCS_GRUPO_INVESTIGACION.sql
The I need to parse all the string that has ??T, but the string not must containt somthing like F1,F34,constrains and others
So I've the following pattern
([a-zA-Z][a-zA-Z][tT]_([a-zA-Z]).*.(sql|SQL)$)
[a-zA-Z][a-zA-Z][tT]_ = check the first and second value could be whatever but I need to be followed by t_ or T_
([a-zA-Z]).* = any value a-z and A-Z any times
(sql|SQL)$ = must be end with sql or SQL
I get something like
ICT_GRUPO_INVESTIGACION_F1.sql
ICT_GRUPO_INVESTIGACION_F2.sql
ICT_GRUPO_INVESTIGACION.sql
But this contains F1,F?,constrains and others
how can I say to the regular expression that in the expression ([a-zA-Z]).* no contains f1 | f? | others_expresion_that_Iwanna
regex? Regexes are usualy quite slow and it will often be faster and easier to useloops andinstatements. You could easily use Pythonsendswithmethod to find .sql files, and theinmethod to exclude files with the patterns you mentioned (e.g.F1,F34).