Python pattern search return only inside quotes

Question:

need help with the output. As of now it outputs the entire line

import re
pattern = re.compile('Computer([0-9]|[1-9][0-9]|[1-9][0-9][0-9])Properties')
with open("Test.xml") as f:
    for line in f:
            if pattern.search(line):
                print(line)

Result

          <Computer0Properties name="BRSM">

          </Computer0Properties>

          <Computer1Properties name="4U-142">

          </Computer1Properties>

What I want no quotes or anything around the results

BRSM
4U-142


Have tried

print(re.findall(r"("[ws]+")",line ))

it outputs

['"BRSM"']
[]
[]

completly missing the second result

Asked By: Amr Mashrah

||

Answers:

import re
pattern = re.compile('Computer([0-9]|[1-9][0-9]|[1-9][0-9][0-9])Properties')
with open("Test.xml") as f:
    for line in f:
            if pattern.search(line):
                print(line.split(""", 4)[1], line.split(""", 4)[3])
                     #BRSM                    4U-142

Answered By: hackerman
with open(filepath) as f:
    for line in f:
        #parse each line returned and return only the names inside the quote
        resultName = re.findall('"([^"]*)"',line )
Answered By: Amr Mashrah