scheda Posted August 10, 2010 Share Posted August 10, 2010 I'm having trouble with this regex... \<span class="yls-rs-listing-title" id="yls-rs-listing-title-\.*\">\.*\</span>\ Here's a sample string that it should be finding it in. <a rel="rel:Link" href="http://local.yahoo.com/info-14094857-curry-phillip-dvm-spca-of-north-brevard-wellness-titusville;_ylt=Aqjid9bbdVokS3CoB.iHLzCHNcIF;_ylv=3?csz=Titusville%2C+FL+32780" class="fn org yltiefix " name="14094857"><span class="yls-rs-listing-title" id="yls-rs-listing-title-14094857" property="dc:title" content="Curry, Phillip DVM - SPCA of North Brevard Wellness">Curry, Phillip DVM - SPCA of North Brevard Wellness</span></a> Any idea why this isn't working? Link to comment https://forums.phpfreaks.com/topic/210380-regex-isnt-creating-results/ Share on other sites More sharing options...
JasonLewis Posted August 11, 2010 Share Posted August 11, 2010 What are you trying to match? What's inbetween the span? Not sure if this is the best way, but try this: #<span class=\"yls-rs-listing-title\".*?>(.*?)</span># Link to comment https://forums.phpfreaks.com/topic/210380-regex-isnt-creating-results/#findComment-1097876 Share on other sites More sharing options...
scheda Posted August 11, 2010 Author Share Posted August 11, 2010 Exactly, that's what I'm after. Sorry, should have clarified! Link to comment https://forums.phpfreaks.com/topic/210380-regex-isnt-creating-results/#findComment-1097889 Share on other sites More sharing options...
cags Posted August 11, 2010 Share Posted August 11, 2010 ProjectFears answer looks roughly correct. The main problem with your original code was the placing of backslashes before the fullstops. This negates it's special meaning of 'catch-all' and makes \.* match 0 or more fullstop characters. Link to comment https://forums.phpfreaks.com/topic/210380-regex-isnt-creating-results/#findComment-1098014 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.