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=\
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;\"";
>
>
* 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);
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
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);
Not that familiar with MySQL's flavor of RegEx (and the documentation seems
to be extremely bad ... or at least I can't seem to find any with casually
searching) but have you tried escaping the RegEx special characters? eg
REGEXP ('ok\/2.0 \(hah 3\.0; BAM oh 5\.1; \.hi CLR 1\.0\.4725\)');
-Peter
> 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
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
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
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
22 matches
Mail list logo