I would like to extract the first url from the array listed below. I want to use Python3 with regular expressions, but I can't match the string.
This is what I tried
import pandas as pd
import re
reg = "\['\S*"
myDataFrame = pd.read_csv('Refactored_Test_1.csv')
imageColumn = myDataFrame.loc[:,"image"]
print(imageColumn)
for element in imageColumn:
print(element)
['https://ui.assets-asda.com/dm/asdagroceries/8000500217078_T1?defaultImage=asdagroceries/noImage&resMode=sharp2&id=nHnSx1&fmt=jpg&fit=constrain,1&wid=188&hei=188', 'https://ui.assets-asda.com/dm/asdagroceries/8000500217078_T2?defaultImage=asdagroceries/noImage&resMode=sharp2&id=PS8Sl2&fmt=jpg&fit=constrain,1&wid=188&hei=188']

\['(\S+)'regex101.com/r/CxZ8NX/1 Or with lookarounds(?<=\[')\S+(?=')regex101.com/r/FeUu6L/1