only get the src value

后端 未结 2 2020
清酒与你
清酒与你 2021-01-20 06:17

I have in the database a field that will always have an tag. and also lots of text..

For example:

Hey there.. whats up?


        
相关标签:
2条回答
  • 2021-01-20 06:27

    You can try this Regex pattern:-

    string pattern= Regex.Match(path, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase).Groups[1].Value;
    
    0 讨论(0)
  • 2021-01-20 06:32

    This question has already been asked here.

    string matchString = Regex.Match(original_text, "<img.+?src=[\"'](.+?)[\"'].+?>", RegexOptions.IgnoreCase).Groups[1].Value;
    
    0 讨论(0)
提交回复
热议问题