Regex r = new Regex(@"<.*?td.*?width.*?=.*?100.*?valign.*?=.*?top.*?>.*?<.*?td.*?valign=.*?top.*?>.*?<.*?a.*?>.*?(<.*?img.*?src.*?=.*?""(\/upload.*?)"".*?>)*?.*?<.*?\/.*?a.*?>.*?<.?a.*?>(.*?)<.*?\/.*?a.*?>.*?<.*?br.*?>.*?<.*?br.*?>(.*?)<.*?span.*?class.*?=.*?catalog-price.*?>(.*?)<.*?\/.*?span.*?>.*?<.*?\/.*?td.*?>",
RegexOptions.IgnoreCase);
I am need that regexp work correct if image is absent in text (image may be present or no). Now it did not work properly. Where is my mistake? Help me, please.
alexfreeman
Member
1 Points
23 Posts
Need help with regular expression
May 27, 2012 09:50 PM|LINK
Hi, guys. I have a regexp.
Regex r = new Regex(@"<.*?td.*?width.*?=.*?100.*?valign.*?=.*?top.*?>.*?<.*?td.*?valign=.*?top.*?>.*?<.*?a.*?>.*?(<.*?img.*?src.*?=.*?""(\/upload.*?)"".*?>)*?.*?<.*?\/.*?a.*?>.*?<.?a.*?>(.*?)<.*?\/.*?a.*?>.*?<.*?br.*?>.*?<.*?br.*?>(.*?)<.*?span.*?class.*?=.*?catalog-price.*?>(.*?)<.*?\/.*?span.*?>.*?<.*?\/.*?td.*?>", RegexOptions.IgnoreCase);
I am need that regexp work correct if image is absent in text (image may be present or no). Now it did not work properly. Where is my mistake? Help me, please.