I need to use a regex in the Find()
function in Python for example, if I use within a loop :
arq = open("arquivo.txt","rb")
var = arq.readline()
a = var.find("abc.*def")
It will be looking at the line "abc something (. *) def" on all lines of the file, beauty
Now, I have two variables containing a string each, I need to call the function Find()
with "Var1. * Var2", ie look for Var1 + anything + Var2
Var1 = "abc"
Var2 = "def"
arq = open("arquivo.txt","rb")
var = arq.readline()
a = var.find(Var1 ".*" Var2) //DESSA FORMA NÃO FUNCIONA
Can anyone help me with how can I do this type of search on the line containing regex?