Regex: ^.*?(?=;)
Value: 00574/KVMK0224.jpg; 00574/1987432370PHANWHCO00MM.jpg
Now only matches: 00574/KVMK0224.jpg
Want: 00574/KVMK0224.jpg and 00574/1987432370PHANWHCO00MM.jpg
As I try to explain shortly I have a string with multiple image links, I made it working to get the first link, but now I want all links. I know how to use regex.Matches in C# to get multiple matches, the only thing I want to know is what regex to use for this.
What I have to get the first link:
Regex regex = new Regex("^.*?(?=;)");
Match match = regex.Match(link);
if (match.Success)
{
part.ImageUrl = match.Value;
}
What I made in order to get all links, I think everything is right on this exept of course the regex
Regex regex = new Regex("^.*?(?=;)");
foreach (Match match in regex.Matches(link))
{
list.Add(match.Value);
}
Probably very simple to do this, but I don't have much experience with regexes.
Thanks in advance!