obtenir seulement la valeur src

J’ai dans la firebase database un champ qui aura toujours une étiquette. et aussi beaucoup de texte ..

Par exemple:

Hey there.. whats up?  .. and this is my photo!.. 

Je dois obtenir SEULEMENT quoi entre le

src

J’ai essayé :

 public ssortingng LinkPicCorrect(ssortingng path) { //ssortingng input = "[img]http://imagesource.com[/img]"; ssortingng pattern = @"\([^\]]+)\\/>"; ssortingng result = Regex.Replace(path, pattern, m => { var url = m.Groups[1].Value; // do something with url here // return the replace value return @""; }, RegexOptions.IgnoreCase); result = ""; return result; } 

Mais j’ai une erreur d’parsing syntaxique:

Détails des exceptions: System.ArgumentException: parsing de “\ ([^]] +) \ />” – Référence à un nom de groupe non défini, img.

ne sais pas si mon code est le bon chemin …

Cette question a déjà été posée ici .

 ssortingng matchSsortingng = Regex.Match(original_text, "", RegexOptions.IgnoreCase).Groups[1].Value; 

Vous pouvez essayer ce motif Regex: –

 ssortingng pattern= Regex.Match(path, "", RegexOptions.IgnoreCase).Groups[1].Value;