RE: Regular Expressions


Subject: RE: Regular Expressions
From: Brian ThunderEagle (thundereagle@hotmail.com)
Date: Mon Jan 05 2004 - 17:46:15 AKST


This solved my problem and it works perfectly now. Thanks you. :)

-----Original Message-----
From: aklug-bounce@aklug.org [mailto:aklug-bounce@aklug.org] On Behalf
Of amv@akvalentine.com
Sent: Monday, January 05, 2004 8:29 PM
To: Brian ThunderEagle
Cc: aklug@aklug.org
Subject: Re: Regular Expressions

If it does indeed work like perl, this should work:
/\[img:.{10}\]/

Where the . means any character, and the {10} means the previous
character
exactly 10 times.

> I am having a heck of a time trying to figure out the format of
regular
> expressions. Particularly I am using the PHP feature preg_replace().
> What I need to do is replace "[img:??????????]" with "<img src=". The
> problem is the "??????????", which stands for 10 characters that I do
> not know and simply need to discard.
>
> Whenever I add anything beyond the following:
> preg_replace("/\[img:/","<img src='",$post_text);
>
> I get an "Unknown Modifier" error for anything that I do. The above
will
> replae the obvious "[img:" but those 10 random characters got me
stuck.
> Whenever I try to look it up online I constantly get sites that have
> just copied the PHP Manual that doesn't even explain how to use the
> commands very well. I would be very grateful If anyone can help or
point
> me in the right direction. As a last note, preg_replace is supposed to
> follow the same rules as Perl.
>
>
> Brian ThunderEagle
> thundereagle@hotmail.com
>
>
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>
>
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Mon Jan 05 2004 - 17:46:13 AKST