I'm frequently new to regex so I'm having a couple issues with the regex expressions I create.
I would like the bolded part of the expression below captured
src="aifwoenflkwenflk"
I have the following expression I created myself:
((?<=src=)|(?<=href=))"(.*?)((?=")|(?='))"
It works but there are two problems,
- It needs to capture only the inside of the quotes, but captures both quotes (Easy fix)
- I need it to support EITHER single or double quotes
I created a new expression that is able to do exactly what I want:
((?<=src=')|(?<=href=')|(?<=src=")|(?<=href="))(.*?)((?=")|(?='))
Though it is very long. There must be some way to optimize it so it is able to use single or double quotes, and only capture the inside. Does anybody know how I can achieve this?
I appreciate all help!