$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
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
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
Hello php list;
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 but
is it greed that is missing the
forward slash
-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
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 below is in a function and $_POST['password1'] is passed to t
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
>
I want to validate someones age. How do I do this in
the ereg function.
I also have some visitors on my site who are in
between the ages of 7-9 so don't forget to make them
part of the ereg function.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsu
hi...
i have the following...
$file = ".txt";
ereg("(\.)([a-z0-9]{3,5})$", $file, $regs);
echo " ww = ".$regs. "";
i'm trying to figure out how to get the portion of the regex that's the
"extension" of the file. my understanding of the docs, says that the
"extension" should be in the $reg
* 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
I'm trying to do graphical smileys for my guestbook, but I've run into a
problem with the crying smilies:
I need to replace :'( and :'-( ... or as they look in the post after being
entered through htmlentities with ent_quotes on:
:'(
:'-(
this causes the entire message to disappear:
$text = er
Having some problems with ereg()
[begin code]
$string="Credit adjusted: $-1.32 to $48.68"
ereg("([\\$(\\$-)][0-9]+\.[0-9]+)",$data[2],$found);
While(list($index,$hits)=each($found))
{
echo "$index , $hits";
}
[end code]
Returns
0
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 chec
This simple script is ment to check to a user nae field but I have done something
wrong.
$pageUserNameValid This should be yes for foo bar.
// Phil
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
Hello,
I'm writing a routine that recursively reads an HTML document, looking for
"special tags". It's a template system, but contrary to what I've seen out
there so far, no template engines allow for any kind of customization from
within the document; they only seem to be variable replacement sys
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
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";
}
I'm running PHP 4.34 on a windows pc. This function is new to me, any help would be
appreciated.
I use this expression to remove oneline comments:
iereg_replace("//([^\n]*)\n",'',$code);
I need to make a check if this expression is inside a string. If it is, its
not a comment.
I think it has something to do with context..
Anyone who could help me?
thanx
--
PHP General Mailing List (http:
* 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
is there any syntax difference between
ereg() and preg() except preg needs / and /?
--
- Eddy Wong
__
inframatrix internet solutions
http://www.inframatrix.com/
¥¿¤KEddy
Regular Octa-Eddy
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@¡½¢ª¢©
[EMAIL PROTECTED]@[EMAIL PROTE
Hi list,
I read through the manual and tried to find something on google, but I
didn't come to anything useful.
It seems that the ereg()-family (I tried ereg(), eregi() and ereg_replace())
can't recognize any special characters such as èéêë etc. I tested this :
and it returned a blank screen.
> -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/
who can tell me what's the pattern string mean.
if(ereg("[\\][n]",$username))
{
/*Do err*/
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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})$", $formsave["dob"], $pa
t;
To: "php list" <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 3:33 AM
Subject: [PHP] Ereg sass
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/publ
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 incl
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 line 27
The same goes for [A-Za-z0-9_-\.]*
Anyone know why?
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: [P
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
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 part.
Many thanks
Peter Gumbrell
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.ph
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
What's wrong with the following regular expression? As far as I can se,
only alphabetic characters including the special swedish ones, should be
let through, but whatever character passed on in $_REQUEST['f_name'] passes
the test?
if(!ereg("(^[a-zA-ZåÅäÄöÖ]{4,20})", $_REQUEST['f_name'])) {
e
Finally, I found y answer to my ereg/grep question.
Thanks to all those who took a stab at it. You led me
to the answer. For all those interested in reg-parsing
comma-delimited lists, here is what I searched for:
'^$'
It was much simpler than I thought it would be. Thanks again!
I have a real problem that I can't seem to figure out.
I need an ereg pattern to search for a certain string
(below). All this is being shelled to a Unix grep
command because I'm looking this up in very many
files.
I've made myself a that
contains in the value attribute a list of
comma-delimited
I'm comparing the values of a check box, against another form field, and
it sort of works, but I don't understand why (A better solution? is
listed below it?
TIA,
David Jackson
---
And part of the HTML Form:
---
Account Type:
Asset
Liability
--
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: "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
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
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(
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("%20", "_",
strtolower($original_name;
Basically, I wan
eas?
---John Holmes...
> -Original Message-
> From: John Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 6:01 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] ereg() not matching same text each time script is
run...
>
> Okay...I'm really at a loss for this...
>
Okay...I'm really at a loss for this...
(PHP 4.0.6 on Redhat Linux)
I've written a little script that shows the top referrers for
http://www.falkware.com. Problem is...the script is supposed to take
"www.domain.com" and strip out only the "domain" to show. It does this,
but only some of the tim
I am trying to validate my input with ereg but I get the error "Warning:
REG_BADBR" when I try over 255 characters. Is there anyway around this?
Works
=
if(eregi('^[A-Za-z]{1,255}$', "test sentence"))
echo "valid input";
Doesn't Work
if(eregi('^[A-Za-z]{1,256}$', "test senten
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
> -
Hi,
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
- may contains some special chars (ex : % ! : ; , )but not in first or last
posi
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
t;
To: "Php-Db-Help (E-mail)" <[EMAIL PROTECTED]>; "Php-General (E-mail)"
<[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 1:04 PM
Subject: [PHP] ereg-digits only...
>
> How do I check a string for it to only contain numbers?
>
> >>
>
>
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 some feedback...
regards,
Bart
--
PHP General Mailing List (http://www.php.net
Hi there! Is there any mean to tell PHP to use ereg etc. greedy?
Thanx,
Kiko
-
It's not a bug, it's a feature.
[.nfq]
christoph starkmann
tel.: 0821 / 56 97 94 34
fax.: 0821 / 56 97 94 38
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-
--
PHP General Mailing List (http://www.php
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
1 - 100 of 168 matches
Mail list logo