RE: [PHP] Regular Expressions....

From: Date: Wed, 22 Aug 2001 00:55:39 +0000
Subject: RE: [PHP] Regular Expressions....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-63835@lists.php.net to get a copy of this message
below > >HEy, i am having major problems trying to work out this regular expression. >Regular expressions are still quite new to me, and i don't fully understand >them, so please bear with me... thanks! regex is a different beast... however if the text that you have isa actually as such, it is difficult if not impossible to create one. bottom>>> > >This is what i wanmt to do, turn the following block of text: > >if (top != self) top.location.replace(self.location.href) rcdb - Mantis <clipped> >Time: 0.040 seconds. > > >Into a nice block of text like this below: > >Mantis <clipped> >spin and a figure-eight finale. > > >CAN ANYONE WHO IS GOOD WITH REGULAR EXPRESSIONS HELP ME WITH THIS!! > >I HAVE AROUND 1000 PAGES TO DO THIS ON!! >PLZ HELP! rather than try to create a regex, a few questions which may help peopl offer a better solution... 1) where are you getting the pages from... files? web sites? xml output? 2) do they appear as you posted in the web browser, or if you view source do they appear a little more organized (ie: the text is formatted, just not for HTML). if all that you have to work with is a mix like you posted (no \n or \r\n in the blob at all) and if there is any wide variety in the descriptions or posts... you would have a difficult time creating a regex that would in one fell swoop correct all your problems. if you have cr's and lf's in the file... we are in business. Dave

« previous php.general (#63835) next »