$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
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
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 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
On Jan 31, 2007, at 4:38 PM, Richard Lynch wrote:
On Tue, January 30, 2007 8:36 pm, jekillen wrote:
I am having trouble with ereg().
The following is the problem code
$x = ereg("", $get_route,
$m);
testing $route I get:
$route = $m[1];
print $route.'';
jk/in' rec='a_378e6dc4.xml' /> (out put o
Hi
In reference to my query about 'greed' in regex in php and the following
code
$x = ereg("",
$get_route, $m);
I solved the immediate problem with the following:
as you can see, the regex is quite a bit more complicated and I
do not know if it will match all the possibilities that it will have
jekillen wrote:
On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote:
jekillen wrote:
Hello php list;
I am having trouble with ereg().
The following is the problem code
$x = ereg("", $get_route,
$m);
do we need to break out of the text to include the $to variable??
The $to variable is what I use t
jekillen wrote:
On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote:
jekillen wrote:
Hello php list;
I am having trouble with ereg().
The following is the problem code
$x = ereg("", $get_route,
$m);
do we need to break out of the text to include the $to variable??
The $to variable is what I use t
On Tue, January 30, 2007 8:36 pm, jekillen wrote:
> I am having trouble with ereg().
> The following is the problem code
> $x = ereg("", $get_route,
> $m);
> testing $route I get:
> $route = $m[1];
> print $route.'';
> jk/in' rec='a_378e6dc4.xml' /> (out put of print)
> jk is all I am looking for b
On Jan 31, 2007, at 8:13 AM, Jim Lucas wrote:
jekillen wrote:
Hello php list;
I am having trouble with ereg().
The following is the problem code
$x = ereg("", $get_route,
$m);
do we need to break out of the text to include the $to variable??
The $to variable is what I use to id the tag to g
jekillen wrote:
Hello php list;
I am having trouble with ereg().
The following is the problem code
$x = ereg("", $get_route, $m);
do we need to break out of the text to include the $to variable??
testing $route I get:
do you mean $get_route?
$route = $m[1];
print $route.'';
jk/in' rec='a_3
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: June 27, 2006 12:58 PM
To: Beauford
Cc: PHP-General
Subject: Re: [PHP] Ereg problem
On Tue, 2006-06-27 at 12:14, Beauford wrote:
> One more in my recent woes. The last elseif does not work in the code
>
Beauford wrote:
Please turn of your mail client's request for return receipts when
sending to a mailing list.
--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
On Tue, 2006-06-27 at 12:14, Beauford wrote:
> One more in my recent woes. The last elseif does not work in the code below
> - even if the string is correct it always says it's incorrect. Even if I
> remove everything else and just have the ereg satement is doesn't work
> either.
>
> The code belo
The ereg function doesn't have the capability to test the age of the
person viewing your page. You have to depend on them to input their
age in some way.
Your answer depends on how your age is submitted. Assuming it is
submited as $_POST['age'], you could perhaps use ereg("0*[7-9]$",
$_POST['age']
Numbers are pretty easy. You could just do:
$age = (int)$_POST['age'];
if($age > 9) do_something();
else do_something_else();
Using ereg doesn't make much sense in this case.
-Rasmus
On Fri, 31 Dec 2004, Michael Lutaaya wrote:
> I want to validate someones age. How do I do this in
>
* Thus wrote Tom Rogers ([EMAIL PROTECTED]):
> Hi,
>
> Thursday, April 15, 2004, 8:56:05 AM, you wrote:
> RB> At 15:02 14-04-2004, Tom Rogers wrote:
>>...
>>
> RB> preg_replace() and ereg_replace(), so it's a bit hard to get a quick
> RB> glimpse of how big the difference really is ... (or for the
Hi,
Thursday, April 15, 2004, 8:56:05 AM, you wrote:
RB> At 15:02 14-04-2004, Tom Rogers wrote:
>>Hi,
>>
>>Thursday, April 15, 2004, 12:51:20 AM, you wrote:
>>RB> Never mind y'all ... me stupid ...
>>
>>RB> obviously the ( has meaning, and needs to be escaped ... was starting to
>>RB> think it cou
At 15:02 14-04-2004, Tom Rogers wrote:
Hi,
Thursday, April 15, 2004, 12:51:20 AM, you wrote:
RB> Never mind y'all ... me stupid ...
RB> obviously the ( has meaning, and needs to be escaped ... was starting to
RB> think it could only do 2 ereg's in 1 script *sigh*
RB> Sorry for wasting time and ban
Hi,
Thursday, April 15, 2004, 12:51:20 AM, you wrote:
RB> Never mind y'all ... me stupid ...
RB> obviously the ( has meaning, and needs to be escaped ... was starting to
RB> think it could only do 2 ereg's in 1 script *sigh*
RB> Sorry for wasting time and bandwidth ... the function now looks lik
Never mind y'all ... me stupid ...
obviously the ( has meaning, and needs to be escaped ... was starting to
think it could only do 2 ereg's in 1 script *sigh*
Sorry for wasting time and bandwidth ... the function now looks like this
and works :
function gfx_smiley($text) {
$smiley_path = 'sm
[snip]
:'(
:'-(
this causes the entire message to disappear:
$text = ereg_replace(':'-?(','',$text);
[/snip]
Have you tried any of the other regular expression functions available?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Don't worry about this I worked out that the example was wrong (o;
- Original Message -
From: "Newman Weekly." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 13, 2004 1:59 PM
Subject: [PHP] ereg problem
This simple script is ment to check to a user nae field but I h
Hi Mirek,
thanks for pointing this out. This looks like a great site -- although, as
you say, will require some [longer term] study.
I'll have closer look at Smarty as well...
"Mirek Novak" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I think that smarty [ http://smarty
Hi,
I think that smarty [ http://smarty.php.net ] can do this for u. It
has tag nesting and, of course, you can define your own tag as a plugin.
As for performance problem - this is known "feature" of regexp. Solution
is not simple. You, IMHO, have to rethink your approach. For parsing
larger
On Fri, Dec 12, 2003 at 07:54:16PM -0800, Manuel Ochoa wrote:
:
: Why is this test failing?
:
: $data = "A Simple test.";
: If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
: echo "Valid text";
: }
: else {
: echo "Not valid text";
: }
You can't use the character class "\s" within a range. And
> Why is this test failing?
> If (ereg("^[a-zA-Z0-9\s.\-_']+$", $data)) {
I'm very new to PHP, so I may be barking up the wrong tree, but what is
that "s" doing after the slash? I don't know if it's the cause of the
problem, but as far as I know it's superfluous.
--
Yoroshiku!
Dave G
[EMAIL PROT
* Thus wrote Eddy-Das ([EMAIL PROTECTED]):
> is there any syntax difference between
> ereg() and preg() except preg needs / and /?
There are a lot of differences in syntax.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
T
> -Original Message-
> From: sven [mailto:[EMAIL PROTECTED]
> Sent: 25 July 2003 10:35
>
> by the way, it's to complicated. the brackets [ and ] are used for
> cha-groups. you can leave them for only one char. so this
> would be the same:
> "\\n" (you have to escape the backslash with a b
by the way, it's to complicated. the brackets [ and ] are used for
cha-groups. you can leave them for only one char. so this would be the same:
"\\n" (you have to escape the backslash with a backslash)
Curt Zirzow wrote:
> * Thus wrote John W. Holmes ([EMAIL PROTECTED]):
>> [EMAIL PROTECTED] wrote
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
> [EMAIL PROTECTED] wrote:
>
> >who can tell me what's the pattern string mean.
> >if(ereg("[\\][n]",$username))
> >{
> > /*Do err*/
> >}
>
> It's looking for a \ character or a \ character followed by the letter n
> anywhere within the string $
[EMAIL PROTECTED] wrote:
who can tell me what's the pattern string mean.
if(ereg("[\\][n]",$username))
{
/*Do err*/
}
It's looking for a \ character or a \ character followed by the letter n
anywhere within the string $username.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/
Beauford, Jason,
Build a bridge and get over it already sheeesh
TYVMIA
Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
gt;
Sent: Monday, March 31, 2003 1:36 AM
Subject: Re: [PHP] Ereg question
> On Monday 31 March 2003 13:58, Beauford wrote:
>
> > I posted the information as I had it. I had no idea what the problem was
> > and posted the information I thought was FULL and ACCURATE -
>
> Fu
On Monday 31 March 2003 13:58, Beauford wrote:
> I posted the information as I had it. I had no idea what the problem was
> and posted the information I thought was FULL and ACCURATE -
Full and accurate if taken literally are absolute terms and are objective not
subjective.
> if this isn't
> g
s once.
B.
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 11:20 PM
Subject: Re: [PHP] Ereg question
> On Monday 31 March 2003 04:15, Beauford wrote:
> > Just some more information. It appears tha
On Monday 31 March 2003 04:15, Beauford wrote:
> Just some more information. It appears that the session variable
> $formsave["dob"] is causing the problem. If I echo the input $_POST['dob']
> it shows correctly, but when it's put into $formsave["dob"] the leading
> and ending 0's are being stripp
> I thought trim only stripped white space.?. $formsave['dob'] is
a
> session variable. I have also found now that leading 0's are also
being
> stripped.
>
> foreach($HTTP_POST_VARS as $varname => $value)
> $formsave[$varname] = trim($value, 50);
>
> If it's not there then the whole
--- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Beauford'" <[EMAIL PROTECTED]>; "'PHP General'"
<[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 2:28 PM
Subject: RE: [PHP] Ereg question
> > I am usi
This is what I get when I echo $formsave["dob"] - 9/09/199. It was
inputted as 09/09/1990.
B.
- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Beauford'" <[EMAIL PROTECTED]>; "'PHP General'"
&l
27;" <[EMAIL PROTECTED]>; "'PHP General'"
<[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 2:28 PM
Subject: RE: [PHP] Ereg question
> > I am using ereg to validate the format of a date entry (mm/dd/yy), but
> if
> > the year ends in a 0, it is bei
> I am using ereg to validate the format of a date entry (mm/dd/yy), but
if
> the year ends in a 0, it is being stripped and as such produces an
error.
> So
> 1990 would be 199. The dob is being inputted by a form
>
> Here is my code:
>
> if (!ereg("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", $form
If you want to look for a dash (-), you always place it last in the
brackets, other wise the regex machine will be looking for a range. So just
move the - to the last character.
[A-Za-z0-9_.-]*
---John Holmes...
- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <
At 10:36 18.03.2003, Jason k Larson said:
[snip]
>It's seeing the - as a range identifier, escape it to get the literal hyphen.
>
>How about this:
>[a-zA-Z0-9_\-.]*
>
>In my tests, the period didn't need to be escaped with the \.
[snip]---
It's seeing the - as a range identifier, escape it to get the literal hyphen.
How about this:
[a-zA-Z0-9_\-.]*
In my tests, the period didn't need to be escaped with the \.
HTH,
Jason k Larson
Liam Gibbs wrote:
I'm not sure why, but I can't include a period in my eregi statement:
[A-Za-z0-9_-.]*
Try
[A-Za-z0-9_\-\.]*
-Original Message-
From: Liam Gibbs [mailto:[EMAIL PROTECTED]
Sent: 18 March 2003 08:52
To: php list
Subject: Re: [PHP] Ereg sass[Scanned]
> try two backslashes to escape php special characters
Tried that with the same result.
> I'm not sure why,
> try two backslashes to escape php special characters
Tried that with the same result.
> I'm not sure why, but I can't include a period in my eregi statement:
>
> [A-Za-z0-9_-.]*
>
> For this, I get Warning: ereg() [function.ereg]: REG_ERANGE in
> /home/website/public_html/Functions.inc on l
try two backslashes to escape php special characters
- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 12:33 AM
Subject: [PHP] Ereg sass
I'm not sure why, but I can't include a period in my eregi statement:
[A-Za-
The problem is that it's looking for hyphen, - , immediately preceeding the end.
Remove the $.
- Original Message -
From: "Peter Gumbrell" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 9:18 AM
Subject: [PHP] ereg usage
Could someone please te
At 16:18 16.02.2003, Peter Gumbrell said:
[snip]
>Could someone please tell me why this code is not working:
>
>ereg ('^[A-H]*([0-9]+)-$', $rank, $matches);
>$workshop_ID = $matches[1][2};
>
>where $rank is something like C12-1 and I just need the C12 par
out
> and see what works.
>
> ---John Holmes...
>
> - Original Message -
> From: "Wico de Leeuw" <[EMAIL PROTECTED]>
> To: "Anders Thoresson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, December 18, 2002 11:26 AM
> Subj
riginal Message -
From: "Wico de Leeuw" <[EMAIL PROTECTED]>
To: "Anders Thoresson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, December 18, 2002 11:26 AM
Subject: Re: [PHP] ereg.
^ is not in this case
Try
if(!ereg("^([a-zA-ZåÅäÄöÖ]{4,20}
At 17:26 18-12-02 +0100, Wico de Leeuw wrote:
^ is not in this case
Cancel that, i don't think thats true
anyway
if(!ereg("^[a-zA-ZåÅäÄöÖ]{4,20}\$", $_REQUEST['f_name'])) {
Should work i think
Gr,
Try
if(!ereg("^([a-zA-ZåÅäÄöÖ]{4,20})\$", $_REQUEST['f_name'])) {
Added the $ at the end else
^ is not in this case
Try
if(!ereg("^([a-zA-ZåÅäÄöÖ]{4,20})\$", $_REQUEST['f_name'])) {
Added the $ at the end else the could be more then 20 chars
Greetz
At 17:20 18-12-02 +0100, Anders Thoresson wrote:
What's wrong with the following regular expression? As far as I can se,
only alphabetic ch
- 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 Description: $35.95
Where the pa
On Friday 03 May 2002 12:51, Jason Soza wrote:
> Hoping someone can help me here. I'm working with someone else's code and
> I'm not familiar with ereg_replace(), can someone provide me an alternative
> to the following?
>
> ereg_replace("[^a-z0-9._]", "",
> ereg_replace (" ", "_",
> ereg_replace(
Someone gave me the preg_match equivalent
preg_match( '/([-_a-z]+)\.([a-z]+)$/i', $row['site'], $match2 );
I tried that and it took care of the problem, as far as I can tell.
To me, that narrows it down to a problem (bug?) with ereg... anyone else
have any ideas?
---John Holmes...
> -Ori
On Tuesday, April 16, 2002, at 09:51 AM, [EMAIL PROTECTED] wrote:
>
> Thanks for this answer.
>
> But how can i test if i actually have numbers AND letters ?
preg_match('/([A-Za-z].*[\d]|[\d].*[A-Za-z]/', $string);
Untested, but in theory should work.
> On Tuesday, April 16, 2002, at 08:49
cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Ereg ()
16/04/02 15:44
On Tuesday, April 16, 2002, at 08:49 AM, [EMAIL PROTECTED] wrote:
>
> I'm new with RegEx and I would like to use them to validate my forms
> entries submitted to the server.
>
> My question is how can I verify with the regex that a string is
> - at least 7 chars
> - contains Chars and Nums
> -
On Tue, 2002-02-12 at 03:04, B. Verbeek wrote:
>
> How do I check a string for it to only contain numbers?
>
> >>
>
> if(!ereg("([0-9]+)",$string)){
>
> print "It contains characters other than numbers";
>
> }else{
>
> print "Only numbers";
>
> }
>
> <<
>
> Can anyone give
ECTED]
- Original Message -
From: "Daniel Kushner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Cc: "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 4:00 PM
Subject: RE: [PHP] ereg-digits only...
> That would
ruary 12, 2002 6:22 AM
> To: [EMAIL PROTECTED]
> Cc: PHP
> Subject: Re: [PHP] ereg-digits only...
>
>
> if ((int($string)==($string)) && ($string>0)) {then positive integer}
>
> not sure exactly, but try
>
> Valentin Petruchek (aki Zliy Pes)
&
> if ((int($string)==($string)) && ($string>0)) {then positive integer}
>
> not sure exactly, but try
Why not use the RE's? I usually use preg_* so I'll give the example
using these...
if (preg_match ("/^\d+$/", $string)) {
print ("Yep... Only digits.");
} else {
prnt ("Noop! There are no
if ((int($string)==($string)) && ($string>0)) {then positive integer}
not sure exactly, but try
Valentin Petruchek (aki Zliy Pes)
*** Cut the beginning ***
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: "B. Verbeek" <[EMAIL PROTECTED]>
To: "Php-Db-Help (E-mail)
otta look for it again
> :-)
>
> Thanks,
>
> Edward
>
> - Original Message -
> From: "Richard Crawford" <[EMAIL PROTECTED]>
> To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday,
IT" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:20 PM
Subject: Re: [PHP] ereg et all - new question..
> Seems like that makes it a LOT easier.
>
> Use eregi_relace() instead of ereg_replace(). eregi allows for
> case-insensitivity.
>
&
;
> > does that make it easier? not for me :-)
> >
> > Greets,
> >
> > Edward
> >
> >
> > - Original Message -----
> > From: "Jeff Sheltren" <[EMAIL PROTECTED]>
> > To: "Edward van Bilderbeek - Bean IT" <[EM
ase,
> the 's should be put around it...
>
> does that make it easier? not for me :-)
>
> Greets,
>
> Edward
>
>
> - Original Message -
> From: "Jeff Sheltren" <[EMAIL PROTECTED]>
> To: "Edward van Bilderbeek - Bean IT" <
ake it easier? not for me :-)
Greets,
Edward
- Original Message -
From: "Jeff Sheltren" <[EMAIL PROTECTED]>
To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:06 PM
Subject: Re: [PHP] er
t; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 11:06 PM
Subject: Re: [PHP] ereg et all
> Ahhh, ok makes more sense now. Although, I don't think that there is an
> "easy" way to do what you are asking. I think that in order to accomplish
>
ltren" <[EMAIL PROTECTED]>
>To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, January 31, 2002 10:56 PM
>Subject: Re: [PHP] ereg et all
>
>
> > I'm not sure why you wanted the last word "tHi
ECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 10:56 PM
Subject: Re: [PHP] ereg et all
> I'm not sure why you wanted the last word "tHis" to be changed to "That"
> (with a capital)... can you explain further?
>
> Jeff
>
> At 10:52 PM
riginal Message -
>From: "Rick Emery" <[EMAIL PROTECTED]>
>To: "'Edward van Bilderbeek - Bean IT'" <[EMAIL PROTECTED]>;
><[EMAIL PROTECTED]>
>Sent: Thursday, January 31, 2002 10:47 PM
>Subject: RE: [PHP] ereg et all
>
>
&
that is not what I meant... I want the cases to remain...
- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Edward van Bilderbeek - Bean IT'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002
try: eregi_replace("this","that","This equals this equals tHis");
-Original Message-
From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ereg et all
hi,
is there a simple way to replace an occu
al Jhunjhunwala [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 11, 2002 3:05 PM
> To: Jimmy
> Cc: php-list
> Subject: Re: [PHP] ereg
>
>
> Nopes, dint work
> Regards,
> Kunal Jhunjhunwala
> - Original Message -
> From: "Jimmy" <[EMAIL PROTECT
You should use preg_match_all() for this.
Something like this should do (didn't try it thou):
preg_match_all("|(.*)\">|U", $lineofhtml,
$output, PREG_PATTERN_ORDER);
Niklas
-Original Message-
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
Sent: 11. tammikuuta 2002 5:56
To: php-l
RE: [PHP] eregWarning: REG_ERANGE on line 83
83: ereg("(.*?)", $lineofhtml, $output);
Regards,
Kunal Jhunjhunwala
- Original Message -
From: Martin Towell
To: 'Kunal Jhunjhunwala' ; Jimmy
Cc: php-list
Sent: Friday, January 11, 2002 9:36 AM
Sub
what about ?
ereg("(.*?)", $lineofhtml, $output);
-Original Message-
From: Kunal Jhunjhunwala [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 3:05 PM
To: Jimmy
Cc: php-list
Subject: Re: [PHP] ereg
Nopes, dint work
Regards,
Kunal Jhunjhunwala
- Original Message
Nopes, dint work
Regards,
Kunal Jhunjhunwala
- Original Message -
From: "Jimmy" <[EMAIL PROTECTED]>
To: "Kunal Jhunjhunwala" <[EMAIL PROTECTED]>
Cc: "php-list" <[EMAIL PROTECTED]>
Sent: Friday, January 11, 2002 9:30 AM
Subject: Re: [PHP] e
Hi Kunal,
> ereg("(.*)", $lineofhtml, $output);
ereg("([^]*)", $lineofhtml, $output);
--
Jimmy
It's not what you have in your life that counts, but who you have in your life
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTE
Something like this will work:
eregi("^id \{([a-z]*),([a-z]+),([a-z]+)\} \[(.+)\]$", $str, $regs);
$regs will be an array containing:
[0] => "id {name,title,nick} [http://www.php.net]";
[1] => "name"
[2] => "title"
[3] => "nick"
[4] => "http://www.php.net";
If course this isn't very foolproof
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 6:35 PM
>Subject: [PHP] ereg help
>
>
>> I'm
That's not regexps Rasmus! :)
I always see you referring us the the manual! sometimes you refer to a
function i never say in my life! ;)
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> http://php.net/is_numeric
>
> On Fri, 5 Oct 2001, Chris Ait
http://php.net/is_numeric
On Fri, 5 Oct 2001, Chris Aitken wrote:
>
> Ive been playing around with ereg for about half an hour and having no joy
> because I dont really understand the medhod behind it and how it all works.
> But what im trying to do is check to see if a 9 digit string is all num
try:
There is a great book on regular expressions by o'reily.
Evan
*** REPLY SEPARATOR ***
On 10/5/01 at 11:33 AM Chris Aitken wrote:
>Ive been playing around with ereg for about half an hour and having no
>joy
>because I dont really understand the medhod behind it and how
To: Chris Aitken; PHP General Mailing List
> Subject: RE: [PHP] ereg checking if its only numbers
>
>
> if(!preg_match("/^\d+$/",$string){
> echo "$string has something other than a number";
> }
>
> -Original Message-
> From: Chris Aitken
if(!preg_match("/^\d+$/",$string){
echo "$string has something other than a number";
}
-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 04, 2001 9:34 PM
To: PHP General Mailing List
Subject: [PHP] ereg checking if its only numbers
Ive bee
use MSIE:[56|5\..|6\..] something like that, i suck at regular expression :D
- Original Message -
From: "Matthew Delmarter" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 01, 2001 1:32 PM
Subject: [PHP] ereg
> How do I use ereg to check for MSIE 5.5
Hello,
check it in the manual: http://www.php.net/manual/en/function.ereg.php
If you don't pass the third -- optional -- argument, then it's true.
Otherwise not.
I don't know this book, but you may keep in my mind that PHP is evolving,
so the online manual can be its most up-to-date documentati
You could try fgets from the fp instead of fread. Then for each line depending
on how well structured it is you have a variety of options, but i think this
would be at least a good start:
www.php.net/preg_split - split on multiple spaces - \s+
jack
Ben Quinn wrote:
> Hi all
>
> Say i had text s
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:
>
Hi Lara,
The problem isn't with the if(ereg) line, its the line above.
Put a semi-colon at the end of your $string = "..[snip].." line
Cheers
- -- - - -
Philip Murray - Senior Systems Engineer
[EMAIL PROTECTED] - Open2View.com
http://www.open2view.com
-
In article <002e01c0e46c$ec2459a0$6e00a8c0@webdesign>,
[EMAIL PROTECTED] ("Jay Paulson") wrote:
> echo ereg("^[a-zA-Z]$", $fname);
>
> as you can see I'm just looking to make sure the variable $fname just has
> characters a-zA-Z and nothing else.
Actually, you're checking whethere the variabl
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 5:18 PM
Subject: Re: [PHP] ereg questions
> Previously, Ker Ruben Ramos said:
> > hmm, got a little question.
> > 1. what's that \\1 and \\2? got any info on where u got that from?
>
> Expands t
" ? i mean.. something like it got
> lots of subdirectories or not.
>
> Thanks
> - Original Message -
> From: "Mark Maggelet" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 24, 2001 1:19 AM
> Subject: Re: [PHP] ere
lt;[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 1:19 AM
Subject: Re: [PHP] ereg questions
> On Thu, 24 May 2001 01:01:16 +0800, Ker Ruben Ramos
> ([EMAIL PROTECTED]) wrote:
> >How do i change all '' to ' >href="file.php?file=anything
: scott [gts]
Cc: Php-General
Subject: Re: [PHP] ereg issues
print preg_replace('/^(.*?)([a-zA-Z]{2})(.*)/','\\2',$blah);
try that
-jack
"scott [gts]" wrote:
>
> oh yeah. sorry...
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mai
1 - 100 of 116 matches
Mail list logo