RE: [PHP] preg_match_all question

2009-01-16 Thread Boyd, Todd M.
> -Original Message- > From: Boyd, Todd M. [mailto:tmbo...@ccis.edu] > Sent: Friday, January 16, 2009 2:13 PM > To: php-general@lists.php.net > Subject: RE: [PHP] preg_match_all question > > > -Original Message- > > From: Robert Cummings [mailto:

RE: [PHP] preg_match_all question

2009-01-16 Thread Boyd, Todd M.
> -Original Message- > From: Robert Cummings [mailto:rob...@interjinn.com] > Sent: Friday, January 16, 2009 4:31 AM > To: Phil Ewington - iModel Ltd. > Cc: php-general@lists.php.net > Subject: Re: [PHP] preg_match_all question > > On Fri, 2009-01-16 at 09:42 +

Re: [PHP] preg_match_all question

2009-01-16 Thread Phil Ewington - iModel Ltd.
Robert Cummings wrote: On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd. wrote: Hi All, Having an issue with regular expressions, never been my strong point! The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to l

Re: [PHP] preg_match_all question

2009-01-16 Thread Robert Cummings
On Fri, 2009-01-16 at 09:42 +, Phil Ewington - iModel Ltd. wrote: > Hi All, > > Having an issue with regular expressions, never been my strong point! > > The following pattern only picks up one instance per line, if more than > one instance exists all text from first {{ to last }} is include

Re: [PHP] preg_match_all nested html text

2008-08-20 Thread Ashley Sheridan
Do you just wish to remove all the HTML tags from a given string? If so, the strip_tags() function should do this. Ash www.ashleysheridan.co.uk --- Begin Message --- I am trying to get the text between nested html tags within arrays produced by preg_match_all. The simple situation would be: te

Re: [PHP] preg_match_all

2008-05-29 Thread Eric Butera
On Thu, May 29, 2008 at 8:13 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > Why not use DOMDocument with getElementsByTagName('href') [1] > > http://us2.php.net/manual/en/domdocument.getelementsbytagname.php > Sorry there was an error in that. It felt wrong when I sent it so I looked again. Here i

Re: [PHP] preg_match_all

2008-05-29 Thread Eric Butera
On Thu, May 29, 2008 at 2:07 PM, Chris W <[EMAIL PROTECTED]> wrote: > What I want to do is find all links in an html file. I have the pattern > below. It works as long as there is only one link on a line and as long as > the whole link is one line. It seems there should be a way to get this to >

Re: [PHP] preg_match_all

2008-05-29 Thread Mario Guenterberg
On Thu, May 29, 2008 at 01:07:11PM -0500, Chris W wrote: > What I want to do is find all links in an html file. I have the pattern > below. It works as long as there is only one link on a line and as long > as the whole link is one line. It seems there should be a way to get > this to work

Re: [PHP] preg_match_all

2008-05-29 Thread Robert Cummings
On Thu, 2008-05-29 at 14:20 -0400, Robert Cummings wrote: > On Thu, 2008-05-29 at 13:07 -0500, Chris W wrote: > > What I want to do is find all links in an html file. I have the pattern > > below. It works as long as there is only one link on a line and as long > > as the whole link is one line

Re: [PHP] preg_match_all

2008-05-29 Thread Robert Cummings
On Thu, 2008-05-29 at 13:07 -0500, Chris W wrote: > What I want to do is find all links in an html file. I have the pattern > below. It works as long as there is only one link on a line and as long > as the whole link is one line. It seems there should be a way to get > this to work with more

Re: [PHP] preg_match_all Help

2007-10-12 Thread Al
m: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: Thursday, October 11, 2007 9:41 PM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] preg_match_all Help [EMAIL PROTECTED] wrote: I have tried this many way and for some reason I cannot pull content between the 2 pattern options.

Re: [PHP] preg_match_all Help

2007-10-12 Thread Richard Heyes
[EMAIL PROTECTED] wrote: ... It would help to see the input text and to know exactly what you're trying to match. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing Lis

RE: [PHP] preg_match_all Help

2007-10-11 Thread admin
ge- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: Thursday, October 11, 2007 9:41 PM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: Re: [PHP] preg_match_all Help [EMAIL PROTECTED] wrote: > I have tried this many way and for some reason > > I cannot pull conte

Re: [PHP] preg_match_all Help

2007-10-11 Thread Jim Lucas
[EMAIL PROTECTED] wrote: I have tried this many way and for some reason I cannot pull content between the 2 pattern options. function pullchannel($document) { preg_match_all('/]*>(.*)]*>/i',$document,$elements); $match = implode("\r\n",$elements[0]); $match = str_rep

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Ólafur Waage
Ive already finished the code and pasted it to this mailing list :) Just an fyi. Ólafur Waage > 2007/8/11, Tijnema <[EMAIL PROTECTED]>: > > On 8/11/07, Stut <[EMAIL PROTECTED]> wrote: > > > Tijnema wrote: > > > > On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote: > > > >> Richard Heyes wrote: >

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Stut <[EMAIL PROTECTED]> wrote: > Tijnema wrote: > > On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote: > >> Richard Heyes wrote: > How can i match an image tag correctly so it does not cause any issues > with how the user adds the image. > >>> preg_match_all('/]*>/Ui'); > >

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Stut
Tijnema wrote: On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote: Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/]*>/Ui'); Off the top of my head. This wouldn't allow for using the right angle br

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Richard Heyes
> < img src="image.jpg"> Your script doesn't catch above ;) So don't write HTML like that. Depends where the HTML is coming from, it might be user input Ok, add \s* after the initial angle bracket. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Ba

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote: > > < img src="image.jpg"> > > > > Your script doesn't catch above ;) > > So don't write HTML like that. > Depends where the HTML is coming from, it might be user input Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Richard Heyes
> < img src="image.jpg"> Your script doesn't catch above ;) So don't write HTML like that. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes <[EMAIL PROTECTED]> wrote: > Richard Heyes wrote: > >> How can i match an image tag correctly so it does not cause any issues > >> with how the user adds the image. > > > > preg_match_all('/]*>/Ui'); > > > > Off the top of my head. This wouldn't allow for using the right a

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Richard Heyes
Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/]*>/Ui'); Off the top of my head. This wouldn't allow for using the right angle bracket in the img tag, but that's almost never going to happen in rea

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread Richard Heyes
How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/]*>/Ui'); Off the top of my head. This wouldn't allow for using the right angle bracket in the img tag, but that's almost never going to happen in reailty. -- Richard Hey

Re: [PHP] preg_match_all to match tags

2007-08-11 Thread tedd
At 11:45 PM + 8/9/07, Ólafur Waage wrote: I know this isn't exactly a php related question but due to the quality of answers ive seen lately ill give this a shot. (yes yes im smoothing up the crowd before the question) I have a weblog system that i am creating, the trouble is that if a user

Re: [PHP] preg_match_all to match tags

2007-08-10 Thread Richard Lynch
On Thu, August 9, 2007 6:45 pm, Ólafur Waage wrote: > I know this isn't exactly a php related question but due to the > quality of answers ive seen lately ill give this a shot. (yes yes im > smoothing up the crowd before the question) > > I have a weblog system that i am creating, the trouble is th

Re: [PHP] preg_match_all to match tags

2007-08-10 Thread Ólafur Waage
[src] => gg.tiff > ) > ) > > I wrote it just as an example. So you may modify it for your needs! > Does anyone know if there is a way to put this into ONE regex?? > > Jan > > -Original Message- > From: brian [mailto:[EMAIL PROTECTED] > Sent: Fr

RE: [PHP] preg_match_all to match tags

2007-08-09 Thread Jan Reiter
) [1] => Array ( [src] => gg.tiff ) ) I wrote it just as an example. So you may modify it for your needs! Does anyone know if there is a way to put this into ONE regex?? Jan -Original Message- From: brian [mailto:[EMAIL PROTECTED] Sent:

Re: [PHP] preg_match_all to match tags

2007-08-09 Thread brian
Ólafur Waage wrote: I know this isn't exactly a php related question but due to the quality of answers ive seen lately ill give this a shot. (yes yes im smoothing up the crowd before the question) I have a weblog system that i am creating, the trouble is that if a user links to an external image

Re: [PHP] preg_match_all for dummies

2005-11-24 Thread Jochem Maas
Kristen G. Thorson wrote: I am a regex retard. good for you ;-) why not take the easy route and simply strip out all HTML comments (and whatever maybe inside them) from the string(s) before you do the search for the 'bbcode'? I am trying to pull keywords out of this crazy bbcode-like file, b

Re: Re: [PHP] preg_match_all problem

2004-11-01 Thread John Holmes
> From: "Ryan A" <[EMAIL PROTECTED]> > $content = str_replace($matches[$index][0],$value,$content); > > If you are interested in seeing the whole script, just scroll down. I'm not... but thanks. Did you read what I wrote? using preg_match twice and then str_replace is a waste. Learn to use preg_

Re: [PHP] preg_match_all problem

2004-11-01 Thread John Holmes
> From: "Ryan A" <[EMAIL PROTECTED]> > Below is my code for a templating kind of script, it basically searches for > 'tags' like this {movies 30} and replaces them, the problem is that if there > are 2 tags (eg: {movies 30}{movies 60}) it only replaces the first one...so > I tried using a preg_mat

Re: [PHP] preg_match_all but no preg_replace_all?

2004-08-10 Thread Justin Patrin
On Tue, 10 Aug 2004 18:51:43 +0200, Marten Lehmann <[EMAIL PROTECTED]> wrote: > Hello, > > I want to be sure, that preg_replace replaces all matches. But it > doesn't accept the /g modifier. And anyhow, there's no preg_replace_all > like there is an preg_match_all. Will preg_replace replace everyt

Re: [PHP] preg_match_all but no preg_replace_all?

2004-08-10 Thread Luke Davison
> I want to be sure, that preg_replace replaces all matches. But it > doesn't accept the /g modifier. And anyhow, there's no preg_replace_all > like there is an preg_match_all. Will preg_replace replace everything by > default? from php.net: mixed preg_replace ( mixed pattern, mixed replacement,

Re: [PHP] Preg_match_all problem

2004-04-12 Thread John Nichel
John W. Holmes wrote: damn... i left out the ending delimiter, too.. :) Chalk one up to Monday. ;) -- *** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \/ /__ _ _| |__ ___ __ ___ _ _

Re: [PHP] Preg_match_all problem

2004-04-12 Thread John W. Holmes
From: "John W. Holmes" <[EMAIL PROTECTED]> > From: "Jeff McKeon" <[EMAIL PROTECTED]> > > > Can anyone see why I'm getting this error message: > > > > "Warning: No ending delimiter '^' found in > > C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126" > > > > From this line: > > > > if(preg_match_al

Re: [PHP] Preg_match_all problem

2004-04-12 Thread John W. Holmes
From: "Jeff McKeon" <[EMAIL PROTECTED]> > Can anyone see why I'm getting this error message: > > "Warning: No ending delimiter '^' found in > C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126" > > From this line: > > if(preg_match_all("^([00])?.*$",$called,$found)) Because you do not have an e

Re: [PHP] Preg_match_all problem

2004-04-12 Thread John Nichel
Jeff McKeon wrote: Can anyone see why I'm getting this error message: "Warning: No ending delimiter '^' found in C:\Inetpub\wwwMIS_DEV\import_mvs.inc.php on line 126" From this line: if(preg_match_all("^([00])?.*$",$called,$found)) { substring($called,2,9); } I basi

Re: [PHP] preg_match_all : not all regular expressions ?

2004-01-26 Thread Tom Rogers
Hi, Saturday, January 24, 2004, 1:00:10 AM, you wrote: JJM> [newbie, please help] JJM> I'm trying to extract all URLs mentionning sound files from blocks of texts. JJM> I first tried with ereg and the following code works fine : JJM> $texte='TEST FIND\net voici un fichier son JJM> http://serve

Re: [PHP] preg_match_all

2003-09-23 Thread Curt Zirzow
* Thus wrote Floris ([EMAIL PROTECTED]): > hi, > I have this piece of code. but the problem is that he also links parts of > words (like: credits) and i wnat only standalone words (like: edit) > Does someone have i idea to correct this piece of code? > > Floris > > { > $regex1 = ">[^<]*("; > $reg

RE: [PHP] preg_match_all()

2003-04-03 Thread Niklas Lampén
He needs both. /s makes dot to include new lines too, so you're right. Niklas -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED] Sent: 3. huhtikuuta 2003 16:26 To: Thomas Johnsson Cc: [EMAIL PROTECTED] Subject: Re: [PHP] preg_match_all() Hi, Thursday, April 3, 200

Re: [PHP] preg_match_all()

2003-04-03 Thread Tom Rogers
Hi, Thursday, April 3, 2003, 11:33:02 PM, you wrote: TJ> I am having problems with preg_match_all spanning over newlines. TJ> Using /m does not seem to ignore the the newlines. TJ> // This works TJ> // Both contents inside and are found TJ> $html = ' TJ> One cell TJ> Another TJ> '; TJ> // This

Re: [PHP] preg_match_all()

2003-03-03 Thread Michael Sims
On Mon, 3 Mar 2003 19:51:09 -0500, you wrote: >preg_match_all('/begincommand(.*)endcommand/',$messagebody,$commandOuttake,P >REG_PATTERN_ORDER); [...] > How >do I change the criteria to stop at the first instance of a match? How do I >parse out only up to the first instance of "endcommand"? Here

RE: [PHP] preg_match_all()

2003-03-03 Thread John W. Holmes
Use a U modifier in your pattern. http://www.php.net/manual/en/pcre.pattern.modifiers.php ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > -Original Message- > From: Vania Smrkovski [mailto:[EMAIL PROTECTED] >

Re: [PHP] preg_match_all - how does it work?

2002-11-17 Thread Jason Wong
On Monday 18 November 2002 01:09, Randall Perry wrote: > That was my understanding. Question is, why don't my print commands > work...or...how do you access 2 dimensional arrays in php? print_r() or var_dump() -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems

Re: [PHP] preg_match_all - how does it work?

2002-11-17 Thread Randall Perry
That was my understanding. Question is, why don't my print commands work...or...how do you access 2 dimensional arrays in php? > Hi Randall, > > If you look closely at the definition of preg_match_all(), you'll see > that it generates an array of arrays--that's because, for each match, it > gener

Re: [PHP] preg_match_all - how does it work?

2002-11-17 Thread Marco Tabini
Hi Randall, If you look closely at the definition of preg_match_all(), you'll see that it generates an array of arrays--that's because, for each match, it generates an array that corresponds to the result of a single call to preg_match, then puts all the resulting array into another array. If you

Re: [PHP] preg_match_all problem

2002-10-10 Thread Archibald Zimonyi
> Hi, I'm a frog (french), > > I,ve some troubles with the preg_match_all function. > > > $strSearchWords = Trim($search); > $pattern = $strSearchWords; > > andwhile (!feof($openFile)) > { > $strFileContents .= fgets(

Re: [PHP] preg_match_all...grrrr!!!

2001-10-23 Thread Christian Reiniger
On Tuesday 23 October 2001 02:47, PHPGalaxy.com wrote: > My matching pattern looks like this: > $engreg = > '/psPhoneEntry.py?firstname=(.*?)&lastname=(.*?)&street=(.*?)&city=(.*? >)&state=(.*?)&zip=(.*?)&phone=(.*?)\">/i'; > > Note the "/" at the beginning, and "/i" at the end. those have always

Re: [PHP] preg_match_all...grrrr!!!

2001-10-22 Thread Pavel Jartsev
"PHPGalaxy.com" wrote: > > ... > > A link from one such entry looks like this: > >psPhoneEntry.py?firstname=Adam&lastname=Collier&street=3912+Foley+Glen+Cir&city=Fenton&state=MI&zip=48430-3435&phone=8107507456 > > My matching pattern looks like this: > $engreg = > >'/psPhoneEntry.py?firstname