Re: Need help with RegEx

From: Date: Mon, 11 Dec 2006 08:42:56 +0000
Subject: Re: Need help with RegEx
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-245702@lists.php.net to get a copy of this message
explode it I'm having quite the difficulty to comprehend the regexp myself, but as a training, go ahead. On Monday 11 December 2006 09:02, Anthony Papillion wrote: > Hello Everyone, > > I am having a bit of problems wrapping my head around regular expressions. > I thought I had a good grip on them but, for some reason, the expression > I've created below simply doesn't work! Basically, I need to retreive all > of the text between two unique and specific tags but I don't need the tag > text. So let's say that the tag is > > <tag lang='ttt'>THIS IS A TEST</tag> > > I would need to retreive THIS IS A TEST only and nothing else. > > Now, a bit more information: I am using cURL to retreive the entire > contents of a webpage into a variable. I am then trying to perform the > following regular expression on the retreived text: > > $trans_text = preg_match("\/<div id=result_box dir=ltr>(.+?)<\/div>/"); > > The problem is that when I echo the value of $trans_text variable, I end up > with the entire HTML of the page. > > Can anyone clue me in to what I am doing wrong? > > Thanks, > Anthony -- --- Børge Kennel Arivene http://www.arivene.net ---

« previous php.general (#245702) next »