Regular Expression to get the SRC of images in C#

后端 未结 8 1519
情深已故
情深已故 2020-11-29 09:34

I\'m looking for a regular expression to isolate the src value of an img. (I know that this is not the best way to do this but this is what I have to do in this case)

8条回答
  •  感情败类
    2020-11-29 09:43

    Here is the one I use:

    (?:(?!\1).)*)\1|(?[^\s>]+))[^>]*?>
    

    The good part is that it matches any of the below:

    
    
    
    

    And it can also match some unexpected scenarios like extra attributes, e.g:

    
    

提交回复
热议问题