Hey all,
I've been fighting this all night, I need a bit of help. I have a string like.
#21-935 Item Description: $35.95
Where the part # could be 10-2034 a combination of 2 and 3 or 4 digits, and the price
could be a combination of 1,2,3 . 2 digits. I want to chop that string into Part # /
Des
Hi William, try this:
^(#[0-9]{2}-[0-9]{2,4} Item Description: [\$][0-9]{1,3}[\.][0-9]{2})$
I've just been putting a number of expressions together for validation
myself.
Regards,
Dave Pratt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Original Message -
From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 6:35 PM
Subject: [PHP] ereg help
> I'm not new for php, but have no experience working with ereg functions.
My
> problem is
I have a dir of html files that link to websites, i would like to read the dir
and print a list of those files as a link. Which the script i have does. I
would like to take this one step further and replace the ".html" extension
with ".com" so it winds up being:
website.com instead of website.ht
- Original Message -
From: "William Glenn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 10:34 AM
Subject: [PHP] Ereg help
Hey all,
I've been fighting this all night, I need a bit of help. I have a string like.
#21-935 Item Des
hi,
I wanna print out all files in a directory. But i wanna exclude ".", "..",
"head.jpg", and all files that start with tn_
Here is my script, but it didn't work. Please help me to solve this problem.
Thank You.
-my script-
while ($file_name = readdir($dir2))
if (($file_name!="."
This is a good starter about PHP and regular expressions.
http://www.phpbuilder.com/columns/dario19990616.php3
>- Original Message -
>From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Monday, December 03, 2001
ms between the braces, and it's enough to get you started.
J
Valentin V. Petruchek wrote:
>
> - Original Message -
> From: "Valentin V. Petruchek" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, December 03, 2001 6:35 PM
> Subject: [
steve wrote:
I have a dir of html files that link to websites, i would like to read the dir
and print a list of those files as a link. Which the script i have does. I
would like to take this one step further and replace the ".html" extension
with ".com" so it winds up being:
website.com instea
On Tuesday 08 January 2008 20:30:29 Chris wrote:
>I usually use preg_* functions so here's my go:
>echo preg_replace('/\.php$/', '.com', $file);
>The '$' at the end makes sure it's a .php file and won't cause problems
>with files like xyz.php.txt .
>(otherwise I'd just use a straight str_replac
On Jan 8, 2008, at 5:45 PM, steve <[EMAIL PROTECTED]> wrote:
I have a dir of html files that link to websites, i would like to
read the dir
and print a list of those files as a link. Which the script i have
does. I
would like to take this one step further and replace the ".html"
extension
$out = basename($file, ".html") . ".com";
fairly limited i think, but simple.
Nothing wrong with being simple, and therefore both fast and easy to
understand by a wider audience. The only downer I can immediately think
of though is that whitespace isn't accommodated, but who really ends a
fi
steve wrote:
On Tuesday 08 January 2008 20:30:29 Chris wrote:
I usually use preg_* functions so here's my go:
echo preg_replace('/\.php$/', '.com', $file);
The '$' at the end makes sure it's a .php file and won't cause problems
with files like xyz.php.txt .
(otherwise I'd just use a str
Try this,
while ($file_name = readdir($dir2)) {
if ($file_name!="." && $file_name!=".." && $file_name!="head.jpg" &&
!ereg(^tn_,$file_name)) {
$files[]=$file_name;
}
}
$numfiles = count($files);
for ($i=$g; $i<$numfiles; $i++){
echo $files[$i];
}
Tom
At 09:45 PM 7/14/01 -0400, you wrote:
>
14 matches
Mail list logo