> -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:
> -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 +
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
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
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 included, can
anyone point out where I am going wrong?
preg_match_all("/\{\{lang:(.*)
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
I am trying to get the text between nested html tags within arrays
produced by preg_match_all. The simple situation would be:
test
I want to return 'test'.
Assuming $post_results has some string derived from a html page source
with lots of nested tags.
Replacing new line (seems to be a goo
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
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
>
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
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
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
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 than one link on a single line. The work around
I have
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.
[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
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
[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
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_replace('"',"","$match");
retu
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:
>
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');
> >
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
> < 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
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
> < 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/
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
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
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
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
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
[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
)
[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:
Ó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
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 larger than 500pixels
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
I am a regex retard.
I am trying to pull keywords out of this crazy bbcode-like file, but
only for bbcode-like code NOT enclosed in HTML comments. I currently
have managed to create this regex:
'/(?)/U'
Which matches
[!keyword::crazy bbcode!]
and not
That's a step in the right directio
Hello,
I am using the following to do link replacing:
preg_match_all("/<\s*a\s+[^>]*href\s*=\s*[\"']?([^\"' >]+)[\"'
>]/isU",$file[$x],$matches);
It works great for all but 'https' links. I am not that versed in
regular expressions. Would anyone know what I need to put in there so
that it w
> 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_
> 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
Hi,
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_match_all...
I tried using a preg_match_all
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
> 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,
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 everything by
default?
Regards
Marten
--
PHP General Mailing List (http://www.php.net/)
To
John W. Holmes wrote:
damn... i left out the ending delimiter, too.. :)
Chalk one up to Monday. ;)
--
***
* _ __ __ __ _ * John Nichel *
* | |/ /___ __ \ \/ /__ _ _| |__ ___ __ ___ _ _
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
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
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
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 basically have a ph
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
[newbie, please help]
I'm trying to extract all URLs mentionning sound files from blocks of texts.
I first tried with ereg and the following code works fine :
$texte='TEST FIND\net voici un fichier son
http://serveur/repertoire/fichier.gig ou
ftp://serveur/repertoire/fichier.snd et
ftp://ser
* 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
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
-
How do I create a preg_match for something like this?
7
PM
I want to store the individual times in an array and then loop through them
if that makes sense...
I tried this but when i try to echo the results back out it doesnt work
preg_match_all("| (.*)\n
\n|U",$read
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
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
I am having problems with preg_match_all spanning over newlines.
Using /m does not seem to ignore the the newlines.
// This works
// Both contents inside and are found
$html = '
One cell
Another
';
// This does not
// Only the contents inside the first and are found
// The only difference is
It's in the manual:
/U/ (PCRE_UNGREEDY)
This modifier inverts the "greediness" of the quantifiers so that
they are not greedy by default, but become greedy if followed by
"?". It is not compatible with Perl. It can also be set by a (?U)
modifier setting within the pattern.
Jay Fitzg
I am having to edit a php script that one of our previous employees had
written and I am having a problem understanding the preg_match_all function.
preg_match_all("||U", $read, $result2);
here is what I THINK I know: The | at the beginning signifies the start of
the text to search for, then th
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
TECTED]
> Sent: Monday, March 03, 2003 7:51 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] preg_match_all()
>
> As described in
http://www.php.net/manual/en/function.preg-match-all.php,
> I
> have put in place a bit of code theoretically designed to parse out
> snippets
>
As described in http://www.php.net/manual/en/function.preg-match-all.php, I
have put in place a bit of code theoretically designed to parse out snippets
of text embraced with an open and close tag. The code I am using is this:
preg_match_all('/begincommand(.*)endcommand/',$messagebody,$commandOut
hi,
i try to parse html data with php's preg_match_all() function.
here is a sample data that i try to parse:
http://www.xxx.com"; class=M>xxx
the regular expression that i use is:
preg_match_all("/([^<]+)<\/a>/",$buffer,$ma
tch);
by this expression i get the same values more then one time. bu
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
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
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
I have some experience in using regular expressions in Perl, and have been
able to use preg_match in php, but am having a problem with preg_match_all.
I'm trying to extract data from an HTML table. Here's my preg_match call
that correctly grabs the 1st row of data in the table. It grabs 4 columns
> 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(
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($openFile, 4096);
Hi All,
I have being working on PHP perl compaitable regular expressions for the last
month and cannot work out how to program a preg_match_all that will get the
"file.html" from the following examples:
The preg_match_all I have below only works for but not for
the other variations..
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
"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
I've never had good luck with this function. I first learned how to
(sorta) use it from looking at other code. It worked fine when I made a
meta search engine, but when I tried on expanding on it, well, I've
started losing hair. =) Here's the scenario:
I'm trying to parse results from Yahoo's Pe
71 matches
Mail list logo