How to select an image link text (html) and erase everything else with Regex?

0

I'm working with a CSV (XML type) file, I'm using a google spreadsheet to clean the data, I'd like to edit a set of cells by making a selection of an image link in html and delete all the rest of the cell using Regex.

The google spreadsheet has the ability to interpret regular expressions (regex) in locating and replacing an item.

An example of the image link is as follows:

src="https://exemplo.files.wordpress.com/2018/04/30656289_1739197086123960_7879125475971301376_o.jpg"

Iwouldalwaysliketofindsrc="https://exemplo.files.wordpress.com/

Then select the rest of the phrase until the quotation marks close. In this example it would be:

/2018/04/30656289_1739197086123960_7879125475971301376_o.jpg

Finally delete all content from the phone and keep only this part of the text:

/2018/04/30656289_1739197086123960_7879125475971301376_o.jpg

Can any sage help me?

    
asked by anonymous 17.04.2018 / 02:26

1 answer

2

Use the expression:

src\="https:\/\/exemplo\.files\.wordpress\.com(.*?)"

in the replace field put $1 which is equivalent to group 1: (.*?)

You can test the expression at regex101.com

    
17.04.2018 / 02:49