Jay wrote:
Why can´t i get this code to work:
$html = $_POST["htmlIn"];
$patterns[0] = "//";
$patterns[1] = "//";
$patterns[2] = "/align=\"left\"/";
$replacements[0] = "";
$replacements[1] = "";
$replacements[2] = " style=\"text-align:left;\"";
$xhtml = preg_replace($patterns, $replacements, $html)
Wudi wrote:
> On Wed, 18 Aug 2004 10:42:54 +0200
> Jay <[EMAIL PROTECTED]> wrote:
>
>
>>Hi!
>>
>>Why can? i get this code to work:
>>$html = $_POST["htmlIn"];
>>
>>$patterns[0] = "//";
>>$patterns[1] = "//";
>>$patterns[2] = "/align=\"left\"/";
>>
>>$replacements[0] = "";
>>$replacements[1] = ""
Ni Shurong wrote:
>>Hi!
>>
>>Why can? i get this code to work:
>>$html = $_POST["htmlIn"];
>>
>>$patterns[0] = "//";
>>$patterns[1] = "//";
>
> $patterns[1] = "/<\/strike>/";
>
>>$patterns[2] = "/align=\"left\"/";
>>
>>$replacements[0] = "";
>>$replacements[1] = "";
>>$replacements[2] = " style=
Ni Shurong wrote:
>>Hi!
>>
>>Why can? i get this code to work:
>>$html = $_POST["htmlIn"];
>>
>>$patterns[0] = "//";
>>$patterns[1] = "//";
>
> $patterns[1] = "/<\/strike>/";
>
>>$patterns[2] = "/align=\"left\"/";
>>
>>$replacements[0] = "";
>>$replacements[1] = "";
>>$replacements[2] = " style=\
To start with try replacing:
$patterns[1] = "//";
with
$patterns[1] = "/<\/strike>/";
Rgds
John
---
Hi!
Why can´t i get this code to work:
$html = $_POST["htmlIn"];
$patterns[0] = "//";
$patterns[1] = "//";
$patterns[2] = "/align=\"left\"/";
$replacements[0] = "";
$replacements[1] = ""
On Wed, 18 Aug 2004 10:42:54 +0200
Jay <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Why can? i get this code to work:
> $html = $_POST["htmlIn"];
>
> $patterns[0] = "//";
> $patterns[1] = "//";
> $patterns[2] = "/align=\"left\"/";
>
> $replacements[0] = "";
> $replacements[1] = "";
> $replacements[2] =
> Hi!
>
> Why can? i get this code to work:
> $html = $_POST["htmlIn"];
>
> $patterns[0] = "//";
> $patterns[1] = "//";
$patterns[1] = "/<\/strike>/";
> $patterns[2] = "/align=\"left\"/";
>
> $replacements[0] = "";
> $replacements[1] = "";
> $replacements[2] = " style=\"text-align:left;\"";
>
>
Hi!
Why can´t i get this code to work:
$html = $_POST["htmlIn"];
$patterns[0] = "//";
$patterns[1] = "//";
$patterns[2] = "/align=\"left\"/";
$replacements[0] = "";
$replacements[1] = "";
$replacements[2] = " style=\"text-align:left;\"";
$xhtml = preg_replace($patterns, $replacements, $html);
Thanx
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]):
> hey professionals out there!
>
> does anybody have a script that parses the error-code from a returned
> email-header (esmtp)?
You dont need a regex, just a simple explode will work:
list($code, $message) = explode(" ", $result_string, 2);
hey professionals out there!
does anybody have a script that parses the error-code from a returned
email-header (esmtp)?
thanx!
Robby
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 24-Jun-2003 Sparky Kopetzky wrote:
> I'm translating (hacking) code from Perl to PHP and have two reg exp
> expressions I can't figure out what they do.
>
> 1st: $goodbadnum =~ tr/0-9//cd; I think this one removes any chars that
> are not numbers.
>
Nope. That removes digits '0-9'
$goodbadnu
I'm translating (hacking) code from Perl to PHP and have two reg exp expressions I
can't figure out what they do.
1st: $goodbadnum =~ tr/0-9//cd; I think this one removes any chars that are not
numbers.
2nd: $goodbadnum =~ tr/0-9/x/; I think this one replaces and numbers with an 'x'.
Right, wr
Jen,
Don't use eregi_replace when str_replace will do.
$contents = str_replace($matches[0][$i], $blah, $contents);
Also the dots should be escaped or gif and jpg without
dots before them will be matched.
preg_match_all('{\/*[A-z0-9_/-]+(\.gif|\.jpg)}', $contents, $matches);
I'm getting much closer to achieving my goal here. Now, I'm missing yet one more
element. Here is my code:
--
$filename = "newexample.html";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
preg_match_all('{\/*[A-z0-9_/-]+(.gif|.jpg)}', $contents, $matche
I need help with some regular expression matching.
Here is what I am doing. In one php file, I'm reading
in the contents of an html file. Both reside on the
same server. What I need to do is change all image
tags that are like this:
To this:
I know that "basename" works if you have somet
CLR 1\.0\.4725\)');
-Peter
> -Original Message-
> From: Taylor York [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, September 21, 2002 00:17
> To: [EMAIL PROTECTED]
> Subject: [PHP] Reg Exp issue
>
>
> Hello, I am trying to find a string in another string with
> mysql
Hello, I am trying to find a string in another string with mysql. Normally,
this would work.
select 'foo' REGEXP ('foo');
And that would simply return 1, since it found it. But, my strings are more
complicated than that.
One good random example is something like this..Ya i know, its wierd but g
Hi!
I need some help with a reg exp
I'm building a little viewer for my
http access logs, and what i'ld like to do is to clean it from alla
hits from my own ip
Take for example:
194.236.30.24 - - [30/Aug/2002:11:46:29 +0200] "GET
/bildgalleri/createjpg.php?url=/v044&file=v044_27.jpg HTT
> On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote:
> >
> > In order to read the headers into an array of header key/value fields
> > i would like a reg exp to remove all new lines/line feeds before a
> > line starting with one or more white spaces or tabs.
Pardon my prior pos
On Thu, 25 Jul 2002, Nicklas af Ekenstam wrote:
> I'm trying to do some parsing of mail headers and since not all
> headers follow the pattern:
>
> X-Header-A: A string
> X-Header-B: Another string that is longer
> X-Header-C: And this string is very very long compared
>
> But may very well look
On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote:
>
> In order to read the headers into an array of header key/value fields
> i would like a reg exp to remove all new lines/line feeds before a
> line starting with one or more white spaces or tabs.
In ereg_replace() you can use
Hi
I'm trying to do some parsing of mail headers and since not all
headers follow the pattern:
X-Header-A: A string
X-Header-B: Another string that is longer
X-Header-C: And this string is very very long compared
But may very well look like this:
X-Header-A: A string
X-Header-B: Another string
On Sat, 1 Jun 2002 16:56:04 +0100, you wrote:
>Hi,
>I've never used a reg exp, but I was trying to do something simple, and I just can't
>seem to do it :)
>
>I have a varible $fdata which contains the contents of a webpage, and I want to strip
>out the tag.
>
>I try:
>$fdata = preg_replace("",
ay, June 01, 2002 6:02 PM
Subject: Re: [PHP] reg exp problems
> On Saturday 01 June 2002 23:56, Andrew Brampton wrote:
> > Hi,
> > I've never used a reg exp, but I was trying to do something simple, and
I
> > just can't seem to do it :)
> >
> > I have a
On Saturday 01 June 2002 23:56, Andrew Brampton wrote:
> Hi,
> I've never used a reg exp, but I was trying to do something simple, and I
> just can't seem to do it :)
>
> I have a varible $fdata which contains the contents of a webpage, and I
> want to strip out the tag.
>
> I try:
> $fdata = pre
Hi,
I've never used a reg exp, but I was trying to do something simple, and I just can't
seem to do it :)
I have a varible $fdata which contains the contents of a webpage, and I want to strip
out the tag.
I try:
$fdata = preg_replace("","",$fdata);
But its stripping out everything between th
or less overhead than a single regular expression?
Thank you.
Zach
-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 11:36 AM
To: Zach Curtis
Subject: Re: [PHP] Reg Exp Help
You said:
> The password and int_id begin
day, January 25, 2002 10:29 AM
To: Zach Curtis
Subject: Re: [PHP] Reg Exp Help
but if the positions as fixed, why don't you use the substr, and then trim
th result?
Edward
- Original Message -
From: "Zach Curtis" <[EMAIL PROTECTED]>
To: "Edward van Bilderbeek
nt: Friday, January 25, 2002 10:29 AM
To: Zach Curtis
Subject: Re: [PHP] Reg Exp Help
but if the positions as fixed, why don't you use the substr, and then trim
th result?
Edward
- Original Message -
From: "Zach Curtis" <[EMAIL PROTECTED]>
To: "Edward van Bild
, it's variable.
Zach
-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 9:58 AM
To: Zach Curtis
Subject: Re: [PHP] Reg Exp Help
how can I see that it isn't a 6 char $password with a 3 char $int_id ??
> Thi
I am trying to code a regular expression that will match at the beginning of
the string the contents of $password, followed by 0 or more occurrences of
white space, followed by the contents of $int_id. The match should be case
insensitive.
Here are some examples of the strings:
This one has a 6
hi all,
two quick reg exp problems:
one:
$username must only contain a-z lowercase, 0-9, no spaces, no other characters.
what would the regexp be?
if(ereg("", $username)) { $valid = "yes" } else { $valid
= "no")
two:
i want to do a really small email validation, just to make s
On Tuesday 13 February 2001 04:59, Scott Mebberson wrote:
> I think that maybe preg_match() or preg_match_all() is the answer but I
> have know idea on how to make the regular expression I am using perl
> comptaible.
>
> Here it is:
> $txt = ereg_replace("src=\"([^>]+)\.(gif|jpg)\"",
> "src=\"http
I really need help with this.
I have written a regular expression that searches for any occurance of
src="*" in a html page and rewrites it so that it is equal to
src="http://www.whereever.com/images/filename.jpg" -
If there are five occurances of this match then it replaces them all. Is
th
I have written a regular expression that searches for any occurance of
src="*" in a html page and rewrites it so that it is equal to
src="http://www.whereever.com/images/filename.jpg" -
If there are five occurances of this match then it replaces them all. Is
there anyway to make it only run once.
35 matches
Mail list logo