[Solved] concat string with result of regular expression python


Here is the best I can do with your description:

i need to concat result of a search ( it could be FG|BG|MG ) with a known string

import re

line = "createNode transform -n \"water\" -p \"FG\";" 

m = search(r'(FG|BG|MG)',line)
if m:
    result = m.groups()[0]

    # What do you want to concat it to? 
    known_string = "known_string" + result

“now i need to search this string. What for? you already searched it.
“zam is unknown – No it is not, it is the result of re.compile()

Sorry, I can’t go further with your description

2

solved concat string with result of regular expression python