Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
Re: [PHP] email validation string.
Old
  (#1)
Roman Neuhauser
Guest
 
Posts: n/a
Default Re: [PHP] email validation string. - 05-14-2007, 03:35 AM

# EMAIL REMOVED / 2007-01-19 14:46:04 +0000:
> >
> >1. Why did you remove the backslash? (the original was correct)
> >

> I have a regular expression tester plugin in firefox and it validates Ok
> with the expression he provided.


JavaScript is *not* PHP.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: [PHP] email validation string.
Old
  (#2)
Roman Neuhauser
Guest
 
Posts: n/a
Default Re: [PHP] email validation string. - 05-14-2007, 03:35 AM

# EMAIL REMOVED / 2007-01-19 15:43:32 +0000:
> >
> >>>1. Why did you remove the backslash? (the original was correct)
> >>>
> >>I have a regular expression tester plugin in firefox and it validates
> >>Ok with the expression he provided.
> >>

> >JavaScript is *not* PHP.

>
> As far as I can read, I never talked about JavaScript...
> Maybe the fact that I talked about a browser made you think I was
> using Java. NO! I'm not. This is a php list and I gave my answer
> based on that. This plugin I was talking about uses PHP/5.2.0


JavaScript is *not* Java. But ok, sorry about the ***umption.
Where can I check out the plugin?

> In either case... Aren't both expressions supposed to validate
> an e-mail??


PHP uses one of two sets of special characters depending on whether you
use single or double quotes, and leaves a single backslash preceeding a
non-special character intact. PCRE removes backslashes if they're
followed by non-special characters (but see /X).

IOW, as opposed to PHP, PCRE will reduce \x to x for any x that's not
special. Use \\x if you want \x.
PHP will, however, reduce \\x to \x, since \ is special.

Relying on PHP's behavior with ordinary-x \x in a PCRE introduces
another grammar to the mix.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: [PHP] email validation string.
Old
  (#3)
Nuno Oliveira
Guest
 
Posts: n/a
Default Re: [PHP] email validation string. - 05-14-2007, 03:35 AM

>Where can I check out the plugin?

Maybe I shouldn't have mentioned plugin and firefox...

It's not a plugin for firefox like other firefox's plugins...
In fact, when I downloaded somewhere arround the web
the name of the thing (won't call it plugin again) was
"Site Programmer Plugin ***istant" (or something alike)
and it's just a bunch of php scripts that run as a local
site...

That's why I said that the "plugin" was using PHP/5.2.0
because that's the php version I have installed.

It needs Apache with PHP support to work and the php
code it uses is a form that processes a text field and do
a ereg($Pattern, $Text) on an if statment that outputs
"Match" or "No Match". Meaning pure PHP (in my case
v5.2.0)

For a real Firefox plugin that shows the matched part
of the text in real time as you change the pattern, you
can search for a plugin (a real one) named "Regular
Expressions Tester". I don't have it but you can search
http://www.mozilla.com for it.
Wait... https://addons.mozilla.org/firefox/2077/ this is
the homepage for the plugin.
However, I don't know if this uses Java(script) or what...

About what I asked in my last post... In php, if you have
a string like $Text="[a-zA-Z]+\\." php will save it like
"[a-zA-Z]+\." because the first backslash is escaping a
special character which is the second backslash but if
you have the string $Text="[a-zA-Z]+\." php will save it
the exactly the same way because even that the backslash
is used to escape special characters, there is no special
char after it. It's just a dot. So the string gets stored the
same way. Also it doesn't get different with quotes or
double quotes.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top