Søren Neigaard wrote:
Hi guys
Im helping a friend with hes internet site, and I have found this
regex email validation regex on the internet:
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-
z]{2,6}(?:\.[a-z]{2})?)$/i;
if(!filter.test(email)) {
return false;
}
On 9/24/07, Per Jessen [EMAIL PROTECTED] wrote:
Hi guys
Im helping a friend with hes internet site, and I have found this
regex email validation regex on the internet:
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-
z]{2,6}(?:\.[a-z]{2})?)$/i;
Hello;
The following regex:
ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})'
id='$m[1]', $groups, $m1);
is causing the following error:
Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on
line 81
Can someone tell me what this means?
What I am trying to
jekillen wrote:
Hello;
The following regex:
ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})'
id='$m[1]', $groups, $m1);
is causing the following error:
Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on
line 81
Can someone tell me what this means?
On Wed, March 14, 2007 7:56 pm, jekillen wrote:
Hello;
The following regex:
ereg(member value='[a-zA-Z ]{1,25}' uspace='([a-z0-9-\.\/]{2,11})'
id='$m[1]', $groups, $m1);
is causing the following error:
Warning: ereg() [function.ereg]: REG_ERANGE in path info_proc.php on
line 81
Can
On Sat, February 3, 2007 12:58 pm, Manolet Gmail wrote:
anyway, PCRE is better that ereg?
Yes!
Faster, easier, more flexible, and better documented.
--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Hi, i have a problem using regex, i want to get all the text between
so i try this...
$subject = 'menu Archer?,-,Chief?,L_Menu2,Big Mouth?,L_Menu3;';
if (ereg('([^]*)', $subject, $regs)) {
print_r($regs);
}
but just return me:
Array
(
[0] = Archer?
[1] = Archer?
)
not return
You have to use preg_match_all()
if (preg_match_all(!\(.+)\!sU, $var, $match))
On Sat, Feb 03, 2007 at 12:36:59PM -0500, Manolet Gmail wrote:
Hi, i have a problem using regex, i want to get all the text between
so i try this...
$subject = 'menu Archer?,-,Chief?,L_Menu2,Big
2007/2/3, Steffen Ebermann [EMAIL PROTECTED]:
You have to use preg_match_all()
if (preg_match_all(!\(.+)\!sU, $var, $match))
oh wow! works very well... but... i take 2 days reading about ereg ='(
there is no way to do this using ereg an not preg (PCRE)...
anyway, PCRE is better that
I don't know, but http://php.net/manual/en/function.ereg.php says
Note: preg_match(), which uses a Perl-compatible regular expression
syntax, is often a faster alternative to ereg().
On Sat, Feb 03, 2007 at 01:58:50PM -0500, Manolet Gmail wrote:
anyway, PCRE is better that ereg?
well thanks you too much, i will learn the preg sintax.
2007/2/3, Steffen Ebermann [EMAIL PROTECTED]:
I don't know, but http://php.net/manual/en/function.ereg.php says
Note: preg_match(), which uses a Perl-compatible regular expression
syntax, is often a faster alternative to
Side note:
$exp = explode('', $var);
foreach ($exp as $key = $val) if ($key%2!=0) $arr[] = $val;
var_dump($arr);
works without regular expressions.
--
Steffen
On Sat, Feb 03, 2007 at 12:36:59PM -0500, Manolet Gmail wrote:
Hi, i have a problem using regex, i want to get all the text
On Sat, 2007-02-03 at 13:58 -0500, Manolet Gmail wrote:
2007/2/3, Steffen Ebermann [EMAIL PROTECTED]:
You have to use preg_match_all()
if (preg_match_all(!\(.+)\!sU, $var, $match))
oh wow! works very well... but... i take 2 days reading about ereg ='(
there is no way to do this
On Thu, October 19, 2006 9:42 am, Robin Vickery wrote:
On 19/10/06, Bagus Nugroho [EMAIL PROTECTED] wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 =
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
Thanks in advance.
bgs
--
PHP General Mailing List (http://www.php.net/)
To
Bagus Nugroho wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
Use preg_replace to replace all numbers with nothing.
$var
On 19 Oct 2006, at 07:49 , Bagus Nugroho wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
Well, stripping the digits is
On 19 Oct 2006, at 07:56 , John Nichel wrote:
$var3 = 'abc 20 def';
Then we want output like :
$var3 = 'abc def';
How regex can help us?.
Use preg_replace to replace all numbers with nothing.
$var = preg_replace ( /\d+/, , $var );
Nope, that will leave
$var3 = 'abc def';
(note the double
Bagus Nugroho wrote:
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
How regex can help us?.
It's very difficult to get the right solution to a problem when all
On 19/10/06, Bagus Nugroho [EMAIL PROTECTED] wrote:
Hi All,
If we have variable like :
$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';
Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';
$re = '/^\s+|\d+\s*|\s*\d+\s*$/';
$var1 =
Hello,
I have some text in a table... the text contains hyperlinks (but not
html coded, i.e. plain Some text...http://www.something.com;)
When i retrieve these texts from the table, i want the hyperlinks to
become clickable, i.e. a href etc added automatically.
Some text...a
On Mon, August 21, 2006 4:51 am, Nadim Attari wrote:
I have some text in a table... the text contains hyperlinks (but not
html coded, i.e. plain Some text...http://www.something.com;)
When i retrieve these texts from the table, i want the hyperlinks to
become clickable, i.e. a href etc added
I have a field that contains a value in parenthesis', but also contains
other text, for instance; (it is a legacy app that I am working with,
and by legacy I am saying pre-1980)
Upper voltage (124.1)
I know that \([0-9]*\) will get me (124.1), but I am totally forgetting
how to get 124.1 without
Jay Blanchard wrote:
I have a field that contains a value in parenthesis', but also contains
other text, for instance; (it is a legacy app that I am working with,
and by legacy I am saying pre-1980)
Upper voltage (124.1)
I know that \([0-9]*\) will get me (124.1), but I am totally forgetting
On Mon, 2006-06-19 at 14:42, John Nichel wrote:
Jay Blanchard wrote:
I have a field that contains a value in parenthesis', but also contains
other text, for instance; (it is a legacy app that I am working with,
and by legacy I am saying pre-1980)
Upper voltage (124.1)
I know that
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg(\(([0-9]*)\), Upper Voltage (124.1), $regs);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[snip]
You won't match the dot btw:
\(([.0-9]*)\)
Which is crude since it will match more than one dot :)
[/snip]
Typo on my part \(([0-9\.]*)\)...but still gets parenthesis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jay Blanchard wrote:
[snip]
\(([0-9]*)\)
[/snip]
I had done this before and still get the parenthesis...
ereg(\(([0-9]*)\), Upper Voltage (124.1), $regs);
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( /\((\d{1,}.*?)\)/, Upper
[snip]
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( /\((\d{1,}.*?)\)/, Upper Voltage (124.1), $regs );
[/snip]
Still returns parentheses
ereg([^\(][0-9\.]* , Upper Voltage (124.1), $regs );
gets rid of opening bracket, but
Jay Blanchard wrote:
[snip]
Anot PCRE. Can't help you there, as I've never used the ereg
functions. However...
preg_match ( /\((\d{1,}.*?)\)/, Upper Voltage (124.1), $regs );
[/snip]
Still returns parentheses
ereg([^\(][0-9\.]* , Upper Voltage (124.1), $regs );
gets rid of
[snip]
Do you have to use ereg? The preg_match pattern I posted works fine.
It will return an array, first element being the whole string it
matched, next element will be what it matched _inside_ the parentheses
(less the parentheses) (if it matches anything that is).
[/snip]
Thanks
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a hint why the regex also is true for text
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me
Dave Goodchild schrieb:
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm
[snip]
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a hint why the regex also is true for
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a
Robin Vickery schrieb:
On 01/06/06, Merlin [EMAIL PROTECTED] wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm
Merlin wrote:
Hi there,
I do work on following regex:
^(.*)_a[0-9](.*).htm$
This should be valid for test_a9393.htm, but not for 9393.htm as
ther is no leading _a infront of the number.
Unfortunatelly this also works for the 9393.htm file. Can somebody give
me a hint why the regex also is
On Thu, June 1, 2006 4:56 am, Merlin wrote:
^(.*)_a[0-9](.*).htm$
Don't know what it will help, but you need \\.htm in PHP to get \.htm
in PCRE to escape the . in the extension.
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On May 16, 2006, at 7:53 PM, Chrome wrote:
-Original Message-
From: Robert Samuel White [mailto:[EMAIL PROTECTED]
Sent: 17 May 2006 01:42
To: php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's [ANSWER]
That's what I was doing. I was parsing A:HREF, IMG:SRC, etc
This one time, at band camp, Robert Samuel White [EMAIL PROTECTED] wrote:
Don't be rude. I've already don't all of that. Nothing came up. I've been
programming for 20 years (since I was 11 years old) so I'm not a slacker
when it comes to learning new things, however, I have always found
Can someone help me modify the following code?
It was designed to search for all instances of [LEVEL#]...[/LEVEL#]
I need a preg_match_all that will search for all of instances of an URL.
It should be sophisticated enough to find something as complicated as this:
Robert Samuel White wrote:
Can someone help me modify the following code?
It was designed to search for all instances of [LEVEL#]...[/LEVEL#]
I need a preg_match_all that will search for all of instances of an URL.
It should be sophisticated enough to find something as complicated as this:
: [PHP] Regex Help for URL's
Robert Samuel White wrote:
Can someone help me modify the following code?
It was designed to search for all instances of [LEVEL#]...[/LEVEL#]
I need a preg_match_all that will search for all of instances of an URL.
It should be sophisticated enough to find
On Tue, 2006-05-16 at 16:31, Robert Samuel White wrote:
Don't be rude. I've already don't all of that. Nothing came up. I've been
programming for 20 years (since I was 11 years old) so I'm not a slacker
when it comes to learning new things, however, I have always found regular
expressions
it makes the email hard to read.
Why is top posting bad?
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 4:28 PM
To: Robert Samuel White
Cc: php-general@lists.php.net
Subject: Re: [PHP] Regex Help for URL's
Robert Samuel White wrote:
Can
I am trying to get all of the urls in a web document, so that I can append
information to the urls when needed (when the url points to a domain that
resides on my server). It allows me to pass session information across the
domains of my network. Currently, I use a class I wrote to handle this,
: Re: [PHP] Regex Help for URL's
Robert Samuel White wrote:
Can someone help me modify the following code?
It was designed to search for all instances of [LEVEL#]...[/LEVEL#]
I need a preg_match_all that will search for all of instances of an URL.
It should be sophisticated enough to find
-Original Message-
From: Robert Samuel White [mailto:[EMAIL PROTECTED]
Sent: 16 May 2006 21:32
To: php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's
Don't be rude. I've already don't all of that. Nothing came up. I've
been
programming for 20 years (since I
In case any one is looking for a solution to a similar problem as me, here
is the answer. I used the code from my original post as my guiding light,
and with some experimentation, I figured it out.
To get any URL, regardless of where it is located, use this:
preg_match_all(#\'http://(.*)\'#U,
On Tue, 2006-05-16 at 18:49, Robert Samuel White wrote:
In case any one is looking for a solution to a similar problem as me, here
is the answer. I used the code from my original post as my guiding light,
and with some experimentation, I figured it out.
To get any URL, regardless of where
On Tue, May 16, 2006 6:21 pm, Robert Cummings wrote:
On Tue, 2006-05-16 at 18:49, Robert Samuel White wrote:
In case any one is looking for a solution to a similar problem as
me, here
preg_match_all(#(\|')http://(.*)(\|')#U, $content, $matches);
And it's missing the original requirement of
All pages used by my content management system must be in a valid format.
Old-school style pages are never created so the solution I have come up with
is perfect for my needs.
Thank you.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-Original Message-
From: Robert Samuel White [mailto:[EMAIL PROTECTED]
Sent: 17 May 2006 01:16
To: php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's [ANSWER]
All pages used by my content management system must be in a valid format.
Old-school style pages
On Tue, May 16, 2006 4:22 pm, Jochem Maas wrote:
personally I would assume anyone who had been programming for 20 yrs
would have a reasonable understanding of regexps.
Nope.
:-)
I got WAY past 20 year mark before I even began to pretend to
understand the minimal amount of regex I can do now.
, then they'll code their pages to make use of this limitation.
-Original Message-
From: Chrome [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 8:24 PM
To: 'Robert Samuel White'; php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's [ANSWER]
-Original Message
-Original Message-
From: Robert Samuel White [mailto:[EMAIL PROTECTED]
Sent: 17 May 2006 01:28
To: php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's [ANSWER]
In my opinion, it is the most reasonable solution. I have looked all over
the web for something else
If we are talking clickable links, why not focus on the a construct
itself? Otherwise URLs are just part of the page's textual content... Very
difficult to parse that
Disseminating an a tag isn't brain-meltingly difficult with a regex if
you put your mind to it... With or without quotes, be
-Original Message-
From: Robert Samuel White [mailto:[EMAIL PROTECTED]
Sent: 17 May 2006 01:42
To: php-general@lists.php.net
Subject: RE: [PHP] Regex Help for URL's [ANSWER]
If we are talking clickable links, why not focus on the a construct
itself? Otherwise URLs are just
Hi,
Saturday, February 4, 2006, 2:53:32 PM, you wrote:
p Hi,
p I'm still trying to get to grips with REGEX and have hit a hurdle with
p the following:
p I have this bit of text:
p (\(EX\) RV-6 )
p I want to remove the '\(EX\)' part of it
p so leaving just: ( RV-6 )
p Any suggestions would be
phplists wrote:
Hi,
I'm still trying to get to grips with REGEX and have hit a hurdle with
the following:
I have this bit of text:
(\(EX\) RV-6 )
I want to remove the '\(EX\)' part of it
so leaving just: ( RV-6 )
$text = '(\(EX\) RV-6 )';
$bits = explode(' ',$text);
$leaving = '(
I have this bit of text:
(\(EX\) RV-6 )
I want to remove the '\(EX\)' part of it
so leaving just: ( RV-6 )
$text = '(\(EX\) RV-6 )';
$str = str_replace('\(EX\)','',$text);
As Burhan put it, regex is not always the solution to your problem -
in most cases, using regex for this kind of
Thanks for that...and yes that would do very nicely.
Unfortunately, for what I'm trying to do, it is of little use. I
probably should have mentioned that the bit of text I used is actually
just part of a much bigger bit of text so exploding on a space would
cause havoc with the rest of it.
Hi Murray,
The length of text is quite long..it is in fact a 150+ page PDF file,
which as it's using an earlier version of PDF I can 'translate' into a
format that I can extract data from..it's just this one bit of text that
I'm stuck on. Yes it does appear multiple times, but the pattern is
Alexis,
Unfortunately, for what I'm trying to do, it is of little use. I
probably should have mentioned that the bit of text I used is actually
just part of a much bigger bit of text so exploding on a space would
cause havoc with the rest of it. Hence the REGEX question.
$text =
I have this bit of text:
(\(EX\) RV-6 )
I want to remove the '\(EX\)' part of it
so leaving just: ( RV-6 )
$text = '(\(EX\) RV-6 )';
$str = str_replace('\(EX\)','',$text);
As Burhan put it, regex is not always the solution to your problem -
in most cases, using regex for this kind
Thanks for the options David.
I think I'll go for the last option as I'm determined to get to grips
with REGEX, and your first choice of REGEX won't work for me as the
'RV-6' bit can be too variable with what it contains, whereas the \(EX\)
bit IS more constant...it's only the EX bit that
Hi,
I'm still trying to get to grips with REGEX and have hit a hurdle with
the following:
I have this bit of text:
(\(EX\) RV-6 )
I want to remove the '\(EX\)' part of it
so leaving just: ( RV-6 )
Any suggestions would be most appreciated.
Thanks
Alexis
--
PHP General Mailing List
I assume that the text inside can change around a fair bit. If the
string is of a fixed with or simple format you can just use substr() and
friends, it's simpler and faster.
That said, there is really two approaches that I can see with this string.
You can match on the spaces to extract the
On Fri, Jan 13, 2006 at 08:25:57AM -0500, Mike Smith wrote:
I'm trying to save myself some time by extracting certain variables
from a string:
102-90 E 42 X 42 X 70 3/8
I've been testing with: http://www.quanetic.com/regex.php
and have been somewhat successful. Using this pattern:
I'm trying to save myself some time by extracting certain variables
from a string:
102-90 E 42 X 42 X 70 3/8
I've been testing with: http://www.quanetic.com/regex.php
and have been somewhat successful. Using this pattern:
/[0-9]{2,}( X| x|x )/
I have:
102-90 E [!MATCH!] [!MATCH!] 70 3/8
Mike Smith wrote:
I'm trying to save myself some time by extracting certain variables
from a string:
102-90 E 42 X 42 X 70 3/8
If this string is always in this format
xxx E panel X width X height
then you could try something like:
// Very much untested
$unit = '102-90 E 42 X 42 X 70 3/8';
This should do the trick:
/(\d+) ?X ?(\d+) ?X ?(\d+ [\d\/]+)/i
(at least it would in Perl)
Le 13 Janvier 2006 08:25, Mike Smith a écrit :
I'm trying to save myself some time by extracting certain variables
from a string:
102-90 E 42 X 42 X 70 3/8
I've been testing with:
Eric, thanks for replying. I couldn't quite get that to work. Albert,
I'm currently working with what you suggested, though the unit names
are not that consistent:
$vals = preg_split(' ?X? ',$unit[1]);
echo strong.$unit[1]./strongbr /\n;
echo Panel: .$vals[0].br /Width: .$vals[1].br /Height:
Okay, maybe it's just the fact that I'm concentration on getting out of
here for the holidays more than I am on my work, but I'm pulling my hair
out. Say I have a string -
Now, is the time; for all good men! to come to the aide? of their
What I want to do is drop everything after (and
John Nichel wrote:
Okay, maybe it's just the fact that I'm concentration on getting out of
here for the holidays more than I am on my work, but I'm pulling my hair
out. Say I have a string -
Now, is the time; for all good men! to come to the aide? of their
What I want to do is drop
Shaun wrote:
Hi M,
Thanks for your help, the code works fine except if there is a line break in
the html, for example
this works
ptest/p
But this doesnt
ptest
/p
Any ideas?
See the last user contributed note from *csaba at alum dot mit dot edu
*at
The second parameter to preg_replace is the replacement string (with
optional backreferences), not another patern.
Use '/p\(.*)(?=\/p)/' for patern, 'a
href=edit_paragraphtext=$1p$1' for replacement string, however,
this does not urlencode the text parameter. You can use
preg_replace_callback
I came across this method of matching brackets with regex in .NET
http://puzzleware.net/blogs/archive/2005/08/13/22.aspx
but I am wondering if it is possible to do the same in PHP?
I've tried it a bit but I can't seem to get it to work properly. I'm
just wondering if I am doing something
I think you are doing it wrong, though reading other people's regex
easily is a skill I lack.
It is however very possible.
The php manual has a section on recursive regex where it explains how to
solve the bracket problem.
Why isn't this regular expression
^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$
allowing for this value:
'Co. Dublin' (w/o the single quotes)
? It's failing the regular expression match...
thnx,
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, 2005-11-18 at 10:55, Chris Boget wrote:
Why isn't this regular expression
^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$
allowing for this value:
'Co. Dublin' (w/o the single quotes)
? It's failing the regular expression match...
Do you have that expression embedded in single or double
Chris,
if (preg_match(/^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$/, Co. Dublin))
echo TRUE;
else
echo FALSE;
prints TRUE for me.
Cheers,
David Grant
Chris Boget wrote:
Why isn't this regular expression
^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$
allowing for this value:
'Co. Dublin' (w/o the
Leonard Burton wrote:
HI,
Tuesday, November 15, 2005, 8:39:19 PM, you wrote:
Here are how they look
W1W
W1AW
WA1W
AD4HZ
N9URK
WB6NOA
4N1UBG
Let's do it this way... What are the rules for a valid callsign?
Basicly, you see an example of each different type of callsign. Other
than the
-Original Message-
From: Leonard Burton [mailto:[EMAIL PROTECTED]
Sent: 16 November 2005 03:39
To: php-general@lists.php.net
Basically here is the regex I used (I am not the best with regexes):
$pattern = /^[0-9]?[A-Z]{1,2}[0-9][A-Z]{1,3}/;
Here are how they look
W1W
W1AW
The only problem with this is that it would take 444 which is not a
valid call.
Wikipedia defines a HAM call sign here:
http://en.wikipedia.org/wiki/Call_sign#Amateur_radio
A regex based upon this definition might be:
/\b(([A-Z]{1,2})|([A-Z][0-9]))[0-9][A-Z]{1,3}\b/
I tested this out a
Hello Leonard,
Tuesday, November 15, 2005, 8:39:19 PM, you wrote:
Here are how they look
W1W
W1AW
WA1W
AD4HZ
N9URK
WB6NOA
4N1UBG
Let's do it this way... What are the rules for a valid callsign?
i.e.
- If it's only three characters, it must start with a letter.
- All callsigns must have
HI,
Tuesday, November 15, 2005, 8:39:19 PM, you wrote:
Here are how they look
W1W
W1AW
WA1W
AD4HZ
N9URK
WB6NOA
4N1UBG
Let's do it this way... What are the rules for a valid callsign?
Basicly, you see an example of each different type of callsign. Other
than the patterns you
Hi All,
Does anyone know of a regex to work for Amateur Radio Callsigns that
will work with any from across the world?
Thanks and 73,
--
Leonard Burton, N9URK
[EMAIL PROTECTED]
The prolonged evacuation would have dramatically affected the
survivability of the occupants.
--
PHP General
On Tue, Nov 15, 2005 at 03:47:21PM -0500, Leonard Burton wrote:
Does anyone know of a regex to work for Amateur Radio Callsigns that
will work with any from across the world?
What does a amateur radio callsign look like? And in what context
are you trying to parse this callsign?
Curt.
--
HI Curt,
Thanks for the reply,
What does a amateur radio callsign look like? And in what context
are you trying to parse this callsign?
Basically here is the regex I used (I am not the best with regexes):
$pattern = /^[0-9]?[A-Z]{1,2}[0-9][A-Z]{1,3}/;
Here are how they look
W1W
W1AW
WA1W
On Tue, Nov 15, 2005 at 10:39:19PM -0500, Leonard Burton wrote:
HI Curt,
Thanks for the reply,
What does a amateur radio callsign look like? And in what context
are you trying to parse this callsign?
Basically here is the regex I used (I am not the best with regexes):
$pattern =
HI Curt,
W1W
W1AW
WA1W
AD4HZ
N9URK
WB6NOA
4N1UBG
Ok, so i can conclude so far we have alpha numeric chars minimum of
3 chars up to 6, this would make a regex:
/[A-Z0-9]{3,6}/
The only problem with this is that it would take 444 which is not a
valid call.
$pattern = /^;
On Wed, Nov 16, 2005 at 12:25:22AM -0500, Leonard Burton wrote:
HI Curt,
W1W
W1AW
WA1W
AD4HZ
N9URK
WB6NOA
4N1UBG
Ok, so i can conclude so far we have alpha numeric chars minimum of
3 chars up to 6, this would make a regex:
/[A-Z0-9]{3,6}/
The only problem with this
On 10/28/05, Tom Rogers [EMAIL PROTECTED] wrote:
I would do it with a small class like this:
?php
class mac{
var $mac='';
var $is_valid = false;
function mac($mac){
$mac = preg_replace('/[^0-9A-F]/','',strtoupper($mac));
if($this-is_valid =
Hi,
Friday, October 28, 2005, 7:20:58 PM, you wrote:
RV On 10/28/05, Tom Rogers [EMAIL PROTECTED] wrote:
I would do it with a small class like this:
RV $mactest = new mac(there are a few gotchas for anyone using this);
print $mactest-is_valid ? valid\n : invalid\n;
RV // valid
RV --
RV PHP
Jochem Maas wrote:
gonna jump on your thread there Jasper, I would
like to comment on your function and ask you a question:
which is 'better' (for what), preg_*() or ereg[i]*()?
preg_*, for anything. They're faster, and more versatile.
--
Richard Heyes
http://www.phpguru.org
--
PHP General
Richard Heyes wrote:
Jochem Maas wrote:
gonna jump on your thread there Jasper, I would
like to comment on your function and ask you a question:
which is 'better' (for what), preg_*() or ereg[i]*()?
preg_*, for anything. They're faster, and more versatile.
cool cheers.
I guess your
Jochem Maas wrote:
Richard Heyes wrote:
Jochem Maas wrote:
gonna jump on your thread there Jasper, I would
like to comment on your function and ask you a question:
which is 'better' (for what), preg_*() or ereg[i]*()?
preg_*, for anything. They're faster, and more versatile.
cool
On Thu, 2005-10-27 at 00:00 +0200, Jochem Maas wrote:
gonna jump on your thread there Jasper, I would
like to comment on your function and ask you a question:
which is 'better' (for what), preg_*() or ereg[i]*()?
I prefer preg_*(), but I used eregi() because I couldn't be bothered
figuring
201 - 300 of 733 matches
Mail list logo