Chris wrote:
snip
preg_replace('/(?!^)([A-Z])/','_$1','JimJoeBobBriggs');
Ohhhregex-fu black belt. ;)
--
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,
Murray @ PlanetThoughtful [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all,
I want to write regular expression for checking the string format
entered
by user.
the allowed formats are
examples:
10
10,
10,12-10
12-10
that is the valid strings are:
1.
On 9/6/05, babu [EMAIL PROTECTED] wrote:
Hi all,
I want to write regular expression for checking the string format entered by
user.
the allowed formats are
examples:
10
10,
10,12-10
12-10
that is the valid strings are:
1. only integer
2. an integer, range of integers example
Hi all,
I want to write regular expression for checking the string format entered
by user.
the allowed formats are
examples:
10
10,
10,12-10
12-10
that is the valid strings are:
1. only integer
2. an integer, range of integers example 3
and no other characters must be
On Tue, 6 Sep 2005, babu wrote:
Hi all,
I want to write regular expression for checking the string format entered by
user.
the allowed formats are
examples:
10
10,
10,12-10
12-10
that is the valid strings are:
1. only integer
2. an integer, range of integers example 3
and no other
babu wrote:
Hi all,
I want to write regular expression for checking the string format entered by user.
the allowed formats are
examples:
10
10,
10,12-10
12-10
that is the valid strings are:
1. only integer
2. an integer, range of integers example 3
and no other characters must be
Hello babu,
Monday, August 29, 2005, 6:50:32 AM, you wrote:
how can i write regular expression for time in 24-hour format i:e,
HH:MM:SS. using preg_match.
?php
$xtime=19:59:53;
if (preg_match(/([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]/, $xtime))
echo Good;
else
echo Bad;
?
--
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote:
Hi Robin
Many thanks for this,
how would one extend this to support the following:
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'mcDonald');
one does not want
$str = insert into user_comment
n Thu, 11 Aug 2005, Leon Vismer wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
/([a-z]+)(ID)/,
Hi
Just a quick note; why dont' you search on user since it's the constant
and replace 'user[A-Z]' with 'user_[a-z]' or in the case of userID
'user[A-Z]{2}'
This is part of my problem user will not always be constant, I basically want
to be able to change between two naming conventions.
On 8/11/05, Leon Vismer [EMAIL PROTECTED] wrote:
Hi
I would like to convert from one naming convention within a sql statement to
another.
I have the following,
code
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'Vismer');
$match = array(
Hi Robin
Many thanks for this,
how would one extend this to support the following:
$str = insert into userComment (userID, userName, userSurname) values (0,
'Leon', 'mcDonald');
one does not want
$str = insert into user_comment (user_id, user_name, user_surname) values (0,
'Leon',
David Christensen wrote:
I just plain suck at regex, so I was hoping to get some hints from you
regex experts out there. I'm sure it's been done a thousand times, but
I can't seem to find what I'm looking for with a simple google search:
$phone could be 1234567890 OR
$phone could be
I'm hoping someone can help me figure out a regex that will replace
pseudo-HTML codes in a string with desired HTML equivalents. In particular,
I'm trying to implement a message quoting facility, such as when you click
on the 'quote' button in phpBB.
Kostyantyn Shakhov wrote:
I have to check the phone number. I use some regular expression for
this. The phone number can contain only numbers and characters like
+,-,),( and space. The problem is when I use a Perl-style all works as
intended but when I use a Posix-style I've got the Warning:
On Saturday 22 January 2005 00:12, Jason wrote:
Simple functions to check fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
Your subject says regular
On Fri, 2005-01-21 at 10:12, Jason wrote:
Simple functions to check fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
?php
/*
* ex.
Jason wrote:
Simple functions to check fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
function fix_mac( $mac ) {
global $mac;
It's really weird to
Richard Lynch wrote:
Jason wrote:
Simple functions to check fix if necessary invalid formating of a MAC
address... I seem to be having problems with the global variable $mac
not being returned from the fix_mac() function. Any help is appreciated.
function fix_mac( $mac ) {
global $mac;
It's
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11
substr($_POST['mobile_number'],0,3) != 447)
{
$error=Invalid Number;
}
On 15 Oct 2004, at 13:38, Shaun wrote:
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11
substr($_POST['mobile_number'],0,3) != 447)
{
$error=Invalid Number;
}
This doesn't verify that the portion following 447 is also a number.
On Friday 15 October 2004 19:38, Shaun wrote:
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried this but with no success
snip
$regexp = /^447[0-9]{9}$/;
if(!preg_match( $regexp, $_POST[mobile_number] )){
$error = Invalid Mobile Number;
Shaun wrote:
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried this but with no success
snip
$regexp = /^447[0-9]{9}$/;
if(!preg_match( $regexp, $_POST[mobile_number] )){
$error = Invalid Mobile Number;
/snip
The number nust be 11 numbers
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
On 15 October 2004 12:39, Shaun wrote:
Hi,
Could anyone help me with a reugular expression for a UK mobile phone
number?
So far I have tried this but with no success
Try is_int($_POST['mobile_number']) or ctype_digit($_POST['mobile_number'])
HTH
Cheers
Chris
Robert Cummings wrote:
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11
substr($_POST['mobile_number'],0,3) != 447)
{
You could add is_integer() into the if statement.
On 15 Oct 2004, at 14:07, Robert Cummings wrote:
On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:
Do you even need a regex?
What about
if (strlen($_POST['mobile_number']) != 11
substr($_POST['mobile_number'],0,3) != 447)
{
Hi Michael,
Thanks very much for the assistance, I'll have to investigate further!
Kind Regards,
Aidan Lister
Michael Sims [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Aidan Lister wrote:
Hello list,
I'm pretty terrible with regular expressions, I was wondering if
someone
Alawi,
You should get some sort of nothing to repeat error. Try moving the * to a +
and putting it after the [0-9]. I'm not sure that the * is picking up anything,
because it's not preceded by anything.
It could be that your $html doesn't match quite right, too (tabs and newlines
differ from
On Thu, 7 Oct 2004 12:12:10 -0500 (CDT), Hans H. Anderson
[EMAIL PROTECTED] wrote:
It could be that your $html doesn't match quite right, too (tabs and newlines
differ from $html to the regular expression). So I tried this with success:
The 's' modifier will assist with matching across
Aidan Lister wrote:
Hello list,
I'm pretty terrible with regular expressions, I was wondering if
someone would be able to help me with this
http://paste.phpfi.com/31964
The problem is detailed in the above link. Basically I need to match
the contents of any HTML tag, except a link. I'm
On Wednesday 29 September 2004 08:46, Ed Lazor wrote:
complain
Today I discovered that my ISP can't upgrade to PHP 5. They use Plesk for
server Administration and PHP 5 apparently breaks Plesk. Plesk says
they'll make PHP 5 support available as soon as it starts coming default on
RedHat
Thanks to everyone who sent in patterns =) They worked like a charm =)
$pattern = /\{\$(.+?)\}/i;
$replacement = \\.\$$1\.\;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Howdy,
Regular expressions are a simple way of matching patters.
You can learn more about regular expressions in general here:
http://www.opengroup.org/onlinepubs/007908799/xbd/re.html
If you are interested in using regular expressions in PHP, check out
these sites:
Hi,
Tuesday, September 14, 2004, 6:04:44 AM, you wrote:
r Hello, would someone please help me with my regular expressions? They are so
r complex!
r Here is what I need to do. I have a string with contents similar to the
r following:
r BLOCK NAME=TOP
r(a bunch of markup code)
From: Skippy [EMAIL PROTECTED]
I'm trying to replace all occurances of the X character in a text
with Y, but only those X's that occur between bold tags (b/b).
?php
$str = 'This X and this X will not be fixed, but bthis X
and/b and hopefully this bX/b should be, along b with
this X also. /b, but
Quoting John Holmes [EMAIL PROTECTED]:
From: Skippy [EMAIL PROTECTED]
I'm trying to replace all occurances of the X character in a text
with Y, but only those X's that occur between bold tags (b/b).
?php
$str = 'This X and this X will not be fixed, but bthis X
and/b and hopefully this
Daniel Lahey wrote:
I'm trying to figure out how to formulate a regular expression that will
get me everything following a pound sign (#) up to the first space or {
character. (I'm trying to parse the ids out of a style sheet.) Can
anyone point me in the right direction? I've been searching
On Tue, 24 Aug 2004 23:53:53 -0700, Daniel Lahey [EMAIL PROTECTED] wrote:
I'm trying to figure out how to formulate a regular expression that
will get me everything following a pound sign (#) up to the first space
or { character. (I'm trying to parse the ids out of a style sheet.)
Can anyone
First of all, you might want to put more than one % probably like %%%
Reason is, asp users % % like php uses ? ?.
Just a precaution.
You almost had the regex right.
/%[a-z]+%/i
Thans means, starts with a %, can match a-z, at least once (the +
part) but as many times (greedy), then another
* Thus wrote Pablo Gosse:
Here's the working regular expresssion:
/^[a-zA-Z0-9\(\)]{1}[ a-zA-Z0-9\(\)_\,\.\-\'\]{1,999}$/
for starters, that doesn't give me a warning at all.
also, all those escapes arn't needed:
$reg = '/^[a-zA-Z0-9()]{1}[ a-zA-Z0-9()_,.\'-]{1,999}$/';
The ' is only
Robin Vickery sagde:
The S modifier that you're using means that it's storing the studied
expression. If the regexp changes each time around the loop then over
3 iterations, that'll add up. See if removing that modifier helps
at all.
The S modifier wasn't needed, I added it because I
Sorry to post this again but it's a little urgent.
The preg_replace in my script allocates a little memory every time it is called and
doesn't free it again untill the script ends.
I don't know if it is normal behaviour for preg_replace or if it is my reg. exp.
that causes this.
The problem is
On Fri, 18 Jun 2004 08:57:19 +0200 (CEST), Ulrik S. Kofod
[EMAIL PROTECTED] wrote:
Sorry to post this again but it's a little urgent.
The preg_replace in my script allocates a little memory every time it is called and
doesn't free it again untill the script ends.
I don't know if it is
On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote:
So I'm trying to implement a simple wiki-like syntax for hyperlinking.
Basically I want to match stuff like [this], where the word 'this' gets
turned into a hyperlink. I have that working, but I want to be able to
escape the
Rob Ellis wrote:
On Thu, May 27, 2004 at 09:59:05AM -0700, Dan Phiffer wrote:
So I'm trying to implement a simple wiki-like syntax for hyperlinking.
Basically I want to match stuff like [this], where the word 'this' gets
turned into a hyperlink. I have that working, but I want to be able to
Chris Boget mailto:[EMAIL PROTECTED]
on Tuesday, May 18, 2004 9:55 AM said:
Why isn't my regex working? From everything that I've
read, it should be...
$string = [joebob];
if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) {
\s Matches any whitespace character; this is equivalent
Chris Boget wrote:
Why isn't my regex working? From everything that I've
read, it should be...
script language=php
$string = [joebob];
if( preg_match( '/\[(\s+)\]/i', $string, $aMatches )) {
print_r( $aMatches );
} else {
echo 'No match was found' . \n\n;
}
/script
Chris
your regex is
Here's a neat little tool I came across while taking an ASP.NET course
at a local college for creating regular expressions. I've used it with
my Perl/PHP scripting also.
Regular Expression Designer
http://www.radsoftware.com.au/web/Default.aspx
Stanley G. Martin
System Administrator
Sprint -
I am trying to create a regular expression for a mobile phone number. The
number must be 12 digits long(0-9) and begin with 447 and have no spaces.
So far I have come up with this but it keeps telling me the number is
invalid even when its correct!
Try this:
$regexp = /447[0-9]{9}/;
Michal Migurski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I am trying to create a regular expression for a mobile phone number. The
number must be 12 digits long(0-9) and begin with 447 and have no spaces.
So far I have come up with this but it keeps telling me the number is
you should also be considering spaces, leading zeros, brackets, dashes
international notation.
/^(((\+|00)[- ]?[0-9]{2,3}[- ]?(\(0\))?[-
]?[1-9]{1}[0-9]{1,})|(0[1-9]{1}[0-9]{1,}))[- ]?(([0-9]{7,})|([0-9]{3}[
-]{1}[0-9]{4}))$/
line-wrapping is unintentional, no garantees as to how good it is.
Thanks for your reply,
but the number cannot be out side the UK or contain spaces, leading zeros,
brackets or dashes
Jochem Maas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
you should also be considering spaces, leading zeros, brackets, dashes
international notation.
but the regular expression still seems to reject the number...
Can you provide an example of numbers it rejects?
My answer was based on the simple fact that you were testing for numbers
that matched, and returning a rejection based on that. The regexp is
simple enough -- some examples of input
I want to extract from a large number of html files everything between
the following specified comments, including the comments themselves:
!--Begin CMS Content--...!-- End CMS Content--
snip
And the regular expression I've got is
'/[!--Begin CMS Content\-\-].+[!-- End CMS Content\-\-]/s'
I
On Apr 8, 2004, at 2:40 PM, Shaun wrote:
Thanks for your reply Michal,
but the regular expression still seems to reject the number...
Just out of curiosity,
Have you tried if(stripslashes(htmlentities($_POST[mobile_number]) )
!= ) ?
--
PHP General Mailing List (http://www.php.net/)
To
preg_match(/To: ([^]+)?([^]+)??/i,$string,$matches);
returns email in $matches[1] in the first instance
and name in $matches[1] and email in $matches[2] in the second.
-Original Message-
From: Robert Kornfeld [mailto:[EMAIL PROTECTED]
Sent: 07 April 2004 09:32
To: [EMAIL PROTECTED]
Alright,
first of all, in E-Mail Headers every param needs to be written in a
seperate line, therefore following will work even with multiple recipients:
$recipients = array();
$header = explode( \n , $header );
foreach ( $header AS $param ) {
$param = trim ( $param );
if ( strtolower(
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]):
hey, professionals out there:
i need to write a parser for an email-header to retrieve the email of the
'To:'-field.
there are 2 possibilities:
'To: [EMAIL PROTECTED]' or
'To: first foo [EMAIL PROTECTED]'
Actually the second one needs to
Mike Mapsnac wrote:
Hello
I found this function online and want to understand how it works.
I don't understand /^ and $/. I know that ^ beginning of the
string but what is /^.
Thanks
function validEmail($email)
{
return
I think he meant.. the carrot after the delimiter
which means NOT.. like /[^a]/ means match anything thats not an 'a'
Jason
Justin Patrin [EMAIL PROTECTED] wrote:
Mike Mapsnac wrote:
Hello
I found this function online and want to understand how it works.
I don't understand /^ and
preg_match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+[a-zA-Z0-9_-]$/,$email);
The / characters are the regex delimiters. This is a throwback to the
Perl language. Basically, the / show where the beginning and end of the
regex is. You *MUST* have them. After the last
On Mon, 2004-02-02 at 14:15, Jas wrote:
I have tried this but its not working.
!eregi(^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$,$_POST['mac'])
so it should match 2 characters 0-9a-fA-F
each block of 2 characters
Adam Bregenzer wrote:
On Mon, 2004-02-02 at 14:15, Jas wrote:
I have tried this but its not working.
!eregi(^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$,$_POST['mac'])
so it should match 2 characters 0-9a-fA-F
each block of 2 characters
Jas wrote:
Adam Bregenzer wrote:
On Mon, 2004-02-02 at 14:15, Jas wrote:
I have tried this but its not working.
!eregi(^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$,$_POST['mac'])
so it should match 2 characters 0-9a-fA-F
each
On Fri, 2004-01-16 at 09:49, Tobias Engelhardt wrote:
Hi list,
i hope someone can help me out... i have to replace
a href=order.php?order_id=12345
with
a href=order_12345.html
any ideas? thank you!
What about just using the variable to build the name?
$file_name =
That is not possible because the id's are hard-coded in thousands of
html-pages. Not a very good idea, i know. It wasn't mine... I *have* to
use search/replace. (A script processes each file in the directory)
Brad Pauly wrote:
What about just using the variable to build the name?
$file_name =
i hope someone can help me out... i have to replace
a href=order.php?order_id=12345
with
a href=order_12345.html
any ideas? thank you!
PCRE style:
'/a href=order.php\?order_id=(\d+)/'
replaced by 'a href=order_$1.html'.
-
On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote:
That is not possible because the id's are hard-coded in thousands of
html-pages. Not a very good idea, i know. It wasn't mine... I *have* to
use search/replace. (A script processes each file in the directory)
Ah, I see. I think you could
On Fri, 2004-01-16 at 10:21, Brad Pauly wrote:
On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote:
That is not possible because the id's are hard-coded in thousands of
html-pages. Not a very good idea, i know. It wasn't mine... I *have* to
use search/replace. (A script processes each
Thanks, that solved the problem...
Mike Migurski wrote:
i hope someone can help me out... i have to replace
a href=order.php?order_id=12345
with
a href=order_12345.html
any ideas? thank you!
PCRE style:
'/a href=order.php\?order_id=(\d+)/'
replaced by 'a href=order_$1.html'.
this, but
they don work yet.
So, please help me~~
Thank you in advance.
Joshua
- Original Message -
Wrom: WIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJ
To: Joshua [EMAIL PROTECTED]
Cc: PHP General list [EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 1:27 PM
Subject: Re: [PHP] Regular Expression
On Sat, 27 Dec 2003, Joshua wrote:
I'm trying to change the string, for example,
$string = 11.abcd.32.efgh.53.ijk;
to
11.abcd.
32.efgh.
53.ijk.
with ereg_replace. Like
ereg_replace(\.[0-9],BR,$string);
How can I recover the original characters after replacing them with BR
in
yet.
So, please help me~~
Thank you in advance.
Joshua
- Original Message -
From: Kelly Hallman [EMAIL PROTECTED]
To: Joshua [EMAIL PROTECTED]
Cc: PHP General list [EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 1:27 PM
Subject: Re: [PHP] Regular Expression
On Sat, 27 Dec 2003
On 27 Nov 2003 at 11:48, Shaun wrote:
Hi,
I need to generate a lowercase alphanumeric passwrord thats 8 characters
long, has anyone got a function that can do this?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Adam i Agnieszka Gasiorowski FNORD wrote:
I'm trying to develop a regex for matching
with preg_match_all, I want to match such things
like image name, image alt text, image title in
construct like this:
html...
div class=class style=style
img src=img=name alt=alt title=title /
span
Sophie Mattoug wrote:
Adam i Agnieszka Gasiorowski FNORD wrote:
I'm trying to develop a regex for matching
with preg_match_all, I want to match such things
like image name, image alt text, image title in
construct like this:
html...
div class=class style=style
img src=img=name alt=alt
Sophie Mattoug wrote:
Adam i Agnieszka Gasiorowski FNORD wrote:
I'm trying to develop a regex for matching with preg_match_all, I
want to match such things like image name, image alt text, image
title in construct like this:
html...
div class=class style=style
img
Sophie Mattoug wrote:
Adam i Agnieszka Gasiorowski FNORD wrote:
I'm trying to develop a regex for matching
with preg_match_all, I want to match such things
like image name, image alt text, image title in
construct like this:
html...
div class=class style=style
img
Sophie Mattoug wrote:
Sophie Mattoug wrote:
Adam i Agnieszka Gasiorowski FNORD wrote:
I'm trying to develop a regex for matching
with preg_match_all, I want to match such things
like image name, image alt text, image title in
construct like this:
html...
div
Adam --
...and then Adam i Agnieszka Gasiorowski FNORD said...
%
...
% How about,
%
% $password = strtolower(substr(md5(uniqid(time())), 0, 7));
Hey, that's pretty slick. Good one! Gonna have to remember that; it's
an excellent trick.
Thanks HAND
:-D
--
David T-G
This should do it, also check the links on the left.
http://php.net/manual/nl/pcre.pattern.syntax.php
Citeren [EMAIL PROTECTED] [EMAIL PROTECTED]:
Hi,
I see from the postings that I should learn Regular Expressions quite fast.
Is there somewhere a decent online tutorial you could
Shaun --
[No need to post twice...]
...and then Shaun said...
%
% Hi,
Hi!
%
% I need to generate a lowercase alphanumeric passwrord thats 8 characters
% long, has anyone got a function that can do this?
This isn't really a regular expression question, since you'd use an
expression to check
...as in...
?
// Could've been done with ASCII sets, but this way
// you can easily tweak the eligible characters.
$eligible='abcdefghijklmnopqrstuvwxyz0123456789';
$pwdLen=8;
$password='';
for($i=0;$i$pwdLen;$i++) {
$password.=$eligible[rand(0,strlen($eligible))];
}
echo(Your
Bogdan --
...and then Bogdan Stancescu said...
%
% ...as in...
%
% ?
% // Could've been done with ASCII sets, but this way
% // you can easily tweak the eligible characters.
% $eligible='abcdefghijklmnopqrstuvwxyz0123456789';
% $pwdLen=8;
% $password='';
% for($i=0;$i$pwdLen;$i++) {
Shaun wrote:
Hi,
I need to generate a lowercase alphanumeric passwrord thats 8 characters
long, has anyone got a function that can do this?
No, but I can write a quick one for you. Can't guarantee the uniqueness
of the password being generated.
function passgen()
{
srand((float) microtime()
David T-G wrote:
Bogdan --
...and then Bogdan Stancescu said...
%
% ...as in...
%
% ?
% // Could've been done with ASCII sets, but this way
% // you can easily tweak the eligible characters.
% $eligible='abcdefghijklmnopqrstuvwxyz0123456789';
% $pwdLen=8;
% $password='';
This condition is true if there is no space, new line or tabulator in $val
I need someone to tell me exactly what this regular-expression means:
if(ereg([^ \t\n],$val)) {
// do the job here
}
I'm looking for an intermittent bug, and I need to understand this to make
sure I have found
Thanks Bronislav for your answer but this can't be it as the following test
code passes validation:
?Php
$val = \t test \n;
if(ereg([^ \t\n],$val)) {
echo 'In here!!';
}
echo 'BR' . nl2br($val);
?
Anyone has an idea?
Bronislav kluèka [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
^ inside [] means not the following chars, so your expression means:
if ($val contains no space , no tab \t and no newline \n) {
//do the job ...
}
Regards,
Matthias
Ben wrote:
I need someone to tell me exactly what this regular-expression means:
if(ereg([^ \t\n],$val)) {
//
From: Bronislav Kluka [EMAIL PROTECTED]
I need someone to tell me exactly what this regular-expression means:
if(ereg([^ \t\n],$val)) {
// do the job here
This condition is true if there is no space, new line or tabulator in $val
Actually, the regular expression will match anything
That's it!
Thank you very much, you have the answer.
I wonder why the programmer did not write the following line instead:
if (strlen(trim($val))) {
// Do the job here
}
Anyways, you just proved that I did not fix the bug! Now I have to work even
more! :-P
Thanks
Matthias Nothhaft [EMAIL
* Thus wrote Matthias Nothhaft ([EMAIL PROTECTED]):
Hi,
^ inside [] means not the following chars, so your expression means:
if ($val contains no space , no tab \t and no newline \n) {
//do the job ...
}
That's not necessarily the correct assesment. rather:
if ($val has any
On Tuesday 05 August 2003 04:19, Ralph Guzman wrote:
Been working on this one for a while but can't get it working properly.
I need a regular expression to match if address is
1. PO Box
2. P.O. Box
3. P.O.Box
I'm using /i to make this case insensitive.
I got it working with 1 2, but
Been working on this one for a while but can't get it working properly.
I need a regular expression to match if address is
1. PO Box
2. P.O. Box
3. P.O.Box
I got it working with 1 2, but it's still not matching 3. Any
suggestions?
if(preg_match( /p[\.]o\.* +box/i,
At 02:45 PM 8/4/2003, Ralph Guzman wrote:
Been working on this one for a while but can't get it working properly.
I need a regular expression to match if address is
1. PO Box
2. P.O. Box
3. P.O.Box
I'm using /i to make this case insensitive.
I got it working with 1 2, but it's still not matching
well, first off '' should not be allowed as a value of an attr= pair
anyways.
You should convert it to gt; or lt;
this will solve that problem.
Jim Lucas
- Original Message -
From: Dan Phiffer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, August 04, 2003 4:03 PM
Subject: [PHP]
Actually, this is for a general purpose templating that might use and or
[ and ] (i.e. [element attribute=value]), but I suppose the same character
entity requirement could be applied to other boundary characters. Somehow
it didn't occur to me.
Thanks for the response,
-Dan
Jim Lucas [EMAIL
* Thus wrote Ralph Guzman ([EMAIL PROTECTED]):
Been working on this one for a while but can't get it working properly.
I need a regular expression to match if address is
1. PO Box
2. P.O. Box
3. P.O.Box
I'm using /i to make this case insensitive.
/p\.?o\.?\s*box/i
I got it working
-Original Message-
From: John [mailto:[EMAIL PROTECTED]
Sent: 12 July 2003 07:31
I need to match a pattern, not in a single-line but from a
HTML page, which
obviously has loads of lines. I need to match 2 lines from
this HTML page:
1) HTMLTITLEFirstVariable - Second
John wrote:
I need to match a pattern, not in a single-line but from a HTML page, which
obviously has loads of lines. I need to match 2 lines from this HTML page:
1) HTMLTITLEFirstVariable - Second Variable/TITLE/HTML
2) TABLETDTR(newline)
ThirdVariable/TR/TD/TABLE...
I tried this code:
1)
101 - 200 of 313 matches
Mail list logo