f



regex in javascript

Hi folks,

I'm trying to learn and understand regex in javascript for web form
validation. In trying to write a piece of script to validate an email
address I came up with the following:


   function isEmail(input)
   {
     var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
     if (!re.exec(input))
     {
       return false
     }
   }

This is then referred to as :

   if (!isEmail(document.form.mailfrom.value))
   {
     alert("This does not look like an email address")
   }

etc.

Unfortunately it bombs on absolutely everything. Can anyone suggest why?

As an aside, is there any truly decent help anywhere on regex? I've got
two manuals, one on perl, the other on javascript, both of which touch on
regex - the perl book is the better of the two for this - but neither are
very good.

Many thanks,

Dave

-- 
Dave Stratford    ZFCA
http://www.argonet.co.uk/users/daves
Hexagon Systems Limited - Experts in VME systems development

0
daves (84)
9/29/2004 10:38:19 PM
comp.sys.acorn.programmer 2499 articles. 0 followers. Post Follow

13 Replies
1250 Views

Similar Articles

[PageSpeed] 19

Dave Stratford <daves@argonet.co.uk>:
> As an aside, is there any truly decent help anywhere on regex? I've got
> two manuals, one on perl, the other on javascript, both of which touch on
> regex - the perl book is the better of the two for this - but neither are
> very good.

There's an O'Reilly book called _Mastering Regular Expressions_:
<URL:http://regex.info>

The regex manpage is comprehensive, but rather dense:
<URL:http://arglist.com/regex/regex7.html>

Of course, there's always:
<URL:http://dmoz.org/Computers/Programming/Languages/Regular_Expressions/>

HTH.

b.

-- 
Ben Shimmin (bas@bas.me.uk)                            <URL:http://bas.me.uk/>
                                finger gpg@bas.me.uk | tail -30 | gpg --import
0
bas7517 (90)
9/29/2004 11:48:09 PM
On Wed, 29 Sep 2004, Dave Stratford wrote:

> Hi folks,
>
> I'm trying to learn and understand regex in javascript for web form
> validation. In trying to write a piece of script to validate an email
> address I came up with the following:
>
>
>    function isEmail(input)
>    {
>      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/

This really isn't the right forum for this, but...

I'm going to describe each bit of the text you have here so that those
without general Regular Expression knowledge might follow what I'm
saying...

^ means 'start of line'
$ means 'end of line'
\w is a word character (a-z, A-Z, 0-9 or _)
* means 'any number of the thing before'
+ means 'one or more of the thing before'
\. means 'a . character'
\- means 'a - character'
() around something means 'group this lot together'
[] around something means 'any of the characters inside here can match'

So what you've written is...

1 Start of line (^)
2 A word character (\w)
3 Any number of... (* - notice that I'm jumping forward through the group
                  to describe this)
  3.1 . or - ([\.\-])
  3.2 A word character (\w)
4 An @ character (@)
5 A word character (\w)
6 One or more of... (+ - again I'm jumping forward to describe this)
  6.1 . or - ([\.\-])
  6.2 A word character (\w)
7 End of line ($)

So, if you want to check that your email address matches you run through
the expression. Let's take my email address 'gerph@gerph.org'.

1 the start of the line
2 'g' matches
3 (we repeatedly do 3.1 and 3.2 until we fail)
   3.1 'e' doesn't match - it's not a . or a -
  We've failed, so 3 is now complete - it says 'any number of', which
  includes no matches.
4 'e' doesn't match - it's not an @ character

We've failed and there's no other retries that we can do so the string
doesn't match your regular expression.

Why have I explained it that way rather than just telling you what's wrong
? Because by following it through you can see where the problem lies. You
expected 2 and 3 to match 'everything on the left of the @', and it was in
3 that the expected matches didn't happen. You wanted 3 to match all of
'erph' from my email address.

So we look at 3.1 because that's where our failure happened. You wanted .
or - which is fine, but you didn't mean that if you wanted the string.
Clause 3 is actually asking for word characters alternating with a . or a
-. For example 'g.e-r-p.h' would match clauses 2 and 3.

What you wanted was 'any word character or . or -' [1]. Since you're
wanting a selection of characters, you want to put it in []'s. And the
characters you want are the '.', '-' and any word character, which are
represented by '\.', '\-', and '\w' respectively. In addition, you want
'any number of these', so you want to follow it by the '*'. So the entire
clause 3 becomes '[\.\-\w]*'.

With this in mind, you can also see that clause 6 is wrong - it needs to
be the same thing, but only 'one or more of...', so '[\.\-\w]+'

And so we come to the final regular expression - we can just dump the bits
that we've changed in place of the clauses that were wrong.

   /^\w[\.\-\w]*@\w[\.\-\w]+$/

As you can see from this, you were very close, but just got the groupings
wrong.


I heartily recommend O'Reilly's 'JavaScript, The Definitive Guide' for
general JS usage (and of course the ECMAScript specification itself if you
want a more specific 'definitive' guide :-) ); for regular expressions,
the POSIX specification is quite handy.



[1] Actually, I'm *assuming* that's what you want. My personal belief is
that you don't want that, because that's not the specification for an
email address - you want an 'addr-spec', as defined in RFC2822. This is
much more complex.

In fact, so complex that I really don't think I can quickly knock up a
regular expression to describe it. Consider that the email address might,
validly, be '"Justin Fletcher"@gerph.org', and indeed that's not the end
of the story, because '(Home address) "Justin Fletcher"@gerph.org (private
address)' is also a valid email address.

-- 
Gerph <http://gerph.org/>
.... All my life I've been waiting for you to bring a fairy tale my way.
0
gerph (209)
9/30/2004 1:56:47 AM
In message <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>
          Justin Fletcher <gerph@gerph.org> wrote:

> On Wed, 29 Sep 2004, Dave Stratford wrote:
> 
> > Hi folks,
> >
> > I'm trying to learn and understand regex in javascript for web form
> > validation. In trying to write a piece of script to validate an email
> > address I came up with the following:
> >
> >
> >    function isEmail(input)
> >    {
> >      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
> 
> And so we come to the final regular expression - we can just dump the bits
> that we've changed in place of the clauses that were wrong.
> 
>    /^\w[\.\-\w]*@\w[\.\-\w]+$/
> 
> As you can see from this, you were very close, but just got the groupings
> wrong.

Even this is not quite enough if you want to ensure that the address has
a FQDN, as the above regex will pass "ab@cd". To ensure a FQDN, e.g.
"ab@cd.ef" or "ab@cd.ef.gh", you need:

  /^\w[\.\-\w]*@\w[\.\-\w]*\.\w+$/

Alan

-- 
RISC OS - you know it makes cents
0
spamhater1 (1060)
9/30/2004 12:11:20 PM
In message <4cf63bd1b1daves@argonet.co.uk>, Dave Stratford
<daves@argonet.co.uk> wrote:

> Hi folks,
> 
> I'm trying to learn and understand regex in javascript for web form
> validation. In trying to write a piece of script to validate an email
> address I came up with the following:
> 
> 
>    function isEmail(input)
>    {
>      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
>      if (!re.exec(input))
>      {
>        return false
>      }
>    }

No return statement is executed when the RE matches, so the function returns
undefined.

-- 
Member AFFS, WYLUG, SWP (UK), ANL, Leeds SA, Leeds Anti-war coalition
OpenPGP key fingerprint: D0A6 F403 9745 CED4 6B3B  94CC 8D74 8FC9 9F7F CFE4
No to software patents!    No to DRM/EUCD - hands off our computers!
0
9/30/2004 2:39:33 PM
In article <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>,
   Justin Fletcher <gerph@gerph.org> wrote:

>   6.2 A word character (\w)

The string after the '@' - the domain name - cannot contain an underscore,
so is not the word character inappropriate here (and for the subsequent
optional strings)?

I am aware of this as I had to drop Pic_Index's underscore for that domain
name.

John

-- 
John Williams, Wirral, Merseyside, UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject
for reliable contact! Who is John Williams? http://www.picindex.info/author/ 
0
UCEbin (2771)
9/30/2004 2:52:32 PM
Alan Wrigley wrote:

> Even this is not quite enough if you want to ensure that the address has
> a FQDN, as the above regex will pass "ab@cd". To ensure a FQDN, e.g.
> "ab@cd.ef" or "ab@cd.ef.gh", you need:

Of course, "Mastering Regular Expressions" has the definitive email 
address regex - all 60 lines of it!

-- 
Jason Tribbeck

newsmaster9@tribbeck.com - 20K download limit - anything larger won't
be received.
0
newsmaster9 (144)
9/30/2004 5:22:52 PM
On Thu, 30 Sep 2004, Alan Wrigley wrote:

> In message <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>
>           Justin Fletcher <gerph@gerph.org> wrote:
>
> > On Wed, 29 Sep 2004, Dave Stratford wrote:
> >
> > > Hi folks,
> > >
> > > I'm trying to learn and understand regex in javascript for web form
> > > validation. In trying to write a piece of script to validate an email
> > > address I came up with the following:
> > >
> > >
> > >    function isEmail(input)
> > >    {
> > >      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
> >
> > And so we come to the final regular expression - we can just dump the bits
> > that we've changed in place of the clauses that were wrong.
> >
> >    /^\w[\.\-\w]*@\w[\.\-\w]+$/
> >
> > As you can see from this, you were very close, but just got the groupings
> > wrong.
>
> Even this is not quite enough if you want to ensure that the address has
> a FQDN, as the above regex will pass "ab@cd". To ensure a FQDN, e.g.
> "ab@cd.ef" or "ab@cd.ef.gh", you need:
>
>   /^\w[\.\-\w]*@\w[\.\-\w]*\.\w+$/

I meant 'close to what he'd intended'; not close to what's required for an
email address. As I mentioned in a footnote, RFC2822 (cute thing on the
part of the RFC editor to give it the same end digits as the previous
standard - RFC822 - I think) the full specification is pretty hairy.

-- 
Gerph <http://gerph.org/>
.... Tearing me away from the quiet; the silence of my soul.
0
gerph (209)
9/30/2004 6:57:05 PM
In article <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>,
   Justin Fletcher <gerph@gerph.org> wrote:
> On Wed, 29 Sep 2004, Dave Stratford wrote:

> > Hi folks,
> >
> > I'm trying to learn and understand regex in javascript for web form
> > validation. In trying to write a piece of script to validate an email
> > address I came up with the following:
> >
> >
> >    function isEmail(input)
> >    {
> >      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/

> This really isn't the right forum for this, but...

[snip]

> And so we come to the final regular expression - we can just dump the
> bits that we've changed in place of the clauses that were wrong.

>    /^\w[\.\-\w]*@\w[\.\-\w]+$/

> As you can see from this, you were very close, but just got the groupings
> wrong.

Okay. I see what I did wrong now. Many many thanks.

FWIW I wasn't trying to confirm an absulutely perfectly valid email
address, just confirm that one entered into the web form looks
approximately correct.

Thanks,

Dave

-- 
Dave Stratford    ZFCA
http://www.argonet.co.uk/users/daves
Hexagon Systems Limited - Experts in VME systems development

0
daves (84)
9/30/2004 10:06:17 PM
In article <ad4086f64c.spamhater@keepyourfilthyspamtoyourself.co.uk>,
   Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> wrote:
> In message <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>
>           Justin Fletcher <gerph@gerph.org> wrote:

> > On Wed, 29 Sep 2004, Dave Stratford wrote:
> > 
> > > Hi folks,
> > >
> > > I'm trying to learn and understand regex in javascript for web form
> > > validation. In trying to write a piece of script to validate an email
> > > address I came up with the following:
> > >
> > >
> > >    function isEmail(input)
> > >    {
> > >      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
> > 
> > And so we come to the final regular expression - we can just dump the
> > bits that we've changed in place of the clauses that were wrong.
> > 
> >    /^\w[\.\-\w]*@\w[\.\-\w]+$/
> > 
> > As you can see from this, you were very close, but just got the
> > groupings wrong.

> Even this is not quite enough if you want to ensure that the address has
> a FQDN, as the above regex will pass "ab@cd". To ensure a FQDN, e.g.
> "ab@cd.ef" or "ab@cd.ef.gh", you need:

>   /^\w[\.\-\w]*@\w[\.\-\w]*\.\w+$/

Okay, I see what you've added, but in that case would it not also be more
correct to add a \w+ immediately before the # to prevent (eg) a.@b.c ?

Dave

-- 
Dave Stratford    ZFCA
http://www.argonet.co.uk/users/daves
Hexagon Systems Limited - Experts in VME systems development

0
daves (84)
9/30/2004 10:09:59 PM
In message <4cf69502f5UCEbin@tiscali.co.uk>
     "John Williams (News)" <UCEbin@tiscali.co.uk> wrote:

>In article <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>,
>   Justin Fletcher <gerph@gerph.org> wrote:
>
>>   6.2 A word character (\w)
>
>The string after the '@' - the domain name - cannot contain an underscore,
>so is not the word character inappropriate here (and for the subsequent
>optional strings)?
>
>I am aware of this as I had to drop Pic_Index's underscore for that domain
>name.

Odd. An underscore is a valid character in a domain name according 
to the standard (rfc2822). A dot atom string (word.word.word) after 
the @ has the same specification as a dot atom string before the @.
-- 
Colin
0
10/1/2004 7:39:15 AM
In message <ad4086f64c.spamhater@keepyourfilthyspamtoyourself.co.uk>
     Alan Wrigley <spamhater@keepyourfilthyspamtoyourself.co.uk> 
     wrote:

>In message <Pine.LNX.4.55.0409300225230.13641@buttercup.gerph.org>
>          Justin Fletcher <gerph@gerph.org> wrote:
>
>> On Wed, 29 Sep 2004, Dave Stratford wrote:
>> 
>> > Hi folks,
>> >
>> > I'm trying to learn and understand regex in javascript for web form
>> > validation. In trying to write a piece of script to validate an email
>> > address I came up with the following:
>> >
>> >
>> >    function isEmail(input)
>> >    {
>> >      var re =/^\w([\.\-]\w)*@\w([\.\-]\w)+$/
>> 
>> And so we come to the final regular expression - we can just dump the bits
>> that we've changed in place of the clauses that were wrong.
>> 
>>    /^\w[\.\-\w]*@\w[\.\-\w]+$/
>> 
>> As you can see from this, you were very close, but just got the groupings
>> wrong.
>
>Even this is not quite enough if you want to ensure that the address has
>a FQDN, as the above regex will pass "ab@cd". To ensure a FQDN, e.g.
>"ab@cd.ef" or "ab@cd.ef.gh", you need:
>
>  /^\w[\.\-\w]*@\w[\.\-\w]*\.\w+$/
>

According to RFC2822 ab@cd is a valid email address. Is FQDN 
something different?

-- 
Colin
0
10/1/2004 8:00:51 AM
In article <eb2df1f64c.colin@colin/granville.gmx.co.uk>,
   Colin Granville <colin.granville@gmx.co.uk> wrote:

> Odd. An underscore is a valid character in a domain name according 
> to the standard (rfc2822). A dot atom string (word.word.word) after 
> the @ has the same specification as a dot atom string before the @.

Perhaps the 'tester' routine on the sites I tried were faulty - but I note
that it is also considered so in this old (pre '.info') PHP expression from
elsewhere:

"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"

(that should now be {2,4} to cope with '.info', AFAICS)

John

-- 
John Williams, Wirral, Merseyside, UK - no attachments to these addresses!
Non-RISC OS posters change user to johnrwilliams or put 'risc' in subject
for reliable contact! Who is John Williams? http://www.picindex.info/author/ 
0
UCEbin (2771)
10/1/2004 9:03:40 AM
Colin Granville <colin.granville@gmx.co.uk>:

[...]

> According to RFC2822 ab@cd is a valid email address. Is FQDN 
> something different?

FQDN is the Fully Qualified Domain Name -- a hostname with its respective
domain name, up to the top-level domain name, included.

b.

-- 
Ben Shimmin (bas@bas.me.uk)                            <URL:http://bas.me.uk/>
                                finger gpg@bas.me.uk | tail -30 | gpg --import
0
bas7517 (90)
10/1/2004 3:40:49 PM
Reply:

Similar Artilces:

Programmers, Programmers, Programmers, ...
As Steve Balmer correctly stated, while making his monkey dance, it is applications and hence programmers that make a platform. The fact though is that if you want to do professional programming, then Linux is the platform for you. I know that this statement will get the heckels up on a lot of trolls in C.O.L.A, but I have a recent experience that proves this. I am currently working for a Windows only house producing a system that receives and transmits around 1000 telegrams per second in each direction on a UDP socket, translates them into a different format and creates a log entry for each ...

regex and Javascript
Hi - I've never tried using regular expressions with JS. Can someone help me with a simple one? I have a field that a user inputs that looks for an integer, or a some integers with a decimal then does some calculations and converts it to currency. Problem is, that if i have to recalculate, that field now has a "$" in it which throws off calculations. I'd like to look at the field and if there is a "$", strip it out, do the calculations, etc. So, something like: function getDollar() { myAmount = window.document.form.amount.value; //here is where i want to look f...

regEx in Javascript
Hi, I'm new to javascript and regEx and trying to solve the following problem. I have a function which validates the password if there is a number: ------------------------------------------------- function findNumeric(str_obj){ regEx = /\d/; if (str_obj.match(regEx)) return true; else return false; } -------------------------------------------------- The problem arises when I put a password with a space in between e.g: 'test test1'. The fucntion returns false. I've tried '\s' in the regEx but the user can put the space anywhere.. Any idea how to sol...

RegEx help in Javascript?
I have a variable named "acct". I first want to remove any "-" characters from it's value. After this I want to verify that we have only exactly 12 digits in the variable. Unfortunately I'm pretty green as far as using RegEx. /\d{12}/.test(acct); should do the second part, but how do I do the first? "Noozer" <dont.spam@me.here> wrote in message news:o0tye.1867503$Xk.369504@pd7tw3no... > I have a variable named "acct". I first want to remove any "-" characters > from it's value. After this I want to verify that we have only exactly 12 > digits in the variable. > > Unfortunately I'm pretty green as far as using RegEx. > > /\d{12}/.test(acct); should do the second part, but how do I do the first? Actually figured out what I needed: f.Acct.value = f.Acct.value.replace(/^(\d{4})-?(\d{4})-?(\d{4})$/,'$1$2$3'); BUT, now I need to go the other way... Assuming that my variable acct contains "123456789012" what expression do I use to get "1234-5678-9012" ??? Noozer wrote: > I have a variable named "acct". I first want to remove any "-" characters > from it's value. yourVar = yourVar.replace(/-/g,""); Daniel Noozer wrote: > Assuming that my variable acct contains "123456789012" what expression do I > use to get "1234-5678-9012" replace(/^(\d{4})(\d{4})(\d{4})$/,"$1-$2-$3&qu...

Javascript book (for programmer)
Hi! I've been recently searching for a book on javascript. There are many books dedicated to advanced javascript programmers (mainly reference material or cookbooks) and some which would interest total beginners (the ones who never programmed at all) - most of these addressed to beginners assume total lack of knowledge in computer space. I was especially disappointed with Beginning Javascript (Wrox Press). I know several programming languages (C, C++ among them) and I'm looking for a book for programmer, which would teach me javascript basics in fast way. P.Rozycki P.S. Sorr...

RCR: regex + regex
Feedback on the following suggestion for ruby: by default allow for adding regex's i.e. >> /foo/ + /bar/ => /foobar/ Thoughts? -r -- Posted via http://www.ruby-forum.com/. On Oct 26, 2009, at 5:13 PM, Roger Pack wrote: > Feedback on the following suggestion for ruby: > by default allow for adding regex's > > i.e. >>> /foo/ + /bar/ > => /foobar/ > > Thoughts? > -r > -- irb> a=/foo/ => /foo/ irb> b=/bar/ => /bar/ irb> class Regexp irb> def +(other) irb> self.class.new(self.to_s + other.to_s) irb> end irb> end => nil irb> a+b => /(?-mix:foo)(?-mix:bar)/ This is obviously too naive an implementation, but if we change a to / foo/i then I'd expect "Foobar" =~ (a+b) to be true (well, I mean 0, of course) and "fooBar" =~ (a+b) to be nil. What might be the corresponding * or - behaviors? It seems like a * b is closer to /(a)*(b)/ than anything else I could think of and that immediately implies: a + b becomes: /(a)+(b)/ rather than just /(a)(b)/ The fact that + is a meaningful character in a Regexp makes a universal meaning for it as an operation *on* regexps a bit ambiguous. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com > What might be the corresponding * or - behaviors? It seems like > a * b > is closer to > /(a)*(b)/ That's what I'd guess for *, as well. > than anything e...

Regex for JavaScript variable identifiers
I'm attempting to make a regex that will match variable identifier names without matching keywords or object properties, and matching function argument names is optional. This attempt seems to work but there has been little QA. rx = /(?:^|[=,;])\s*([a-zA-Z_$][\w$]*)\s*(?=\=)|\bvar\s*([a-zA-Z_$][\w$]*)\s* (?=[=,;\n])/g; If anyone can spot potential problems and/or how to improve them, please let me know. Thanks in advance. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! ...

javascript within a javascript
Hello, I have a multi-frame page. The frames are named Frame_1, Frame_2 and Frame_3. Frame_1 has a drop down box. When a value is selected in this drop down box, Frame_2 is updated using an asp file (as I have to read from a back-end access database). In turn in the asp file, I have a Body onload tag to execute a javascript function within Frame_2. this function updates the contents of Frame_3. Till now this is working fine. Here is the problem. Frame_3 has a form with a radio button. When a radio button is selected, I want that a function be executed in Frame_3. However since conte...

RISCOS/Acorn Eprom programmer
Hi, Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 A5000? Must blow up to 256Kbit bog standard ST EPROMs. Cheers all, - Chris. In message <3fdd0a07$0$10357$fa0fcedb@lovejoy.zen.co.uk> "Chris Smith" <chris@FARPinfinitemonkeys.org.uk> wrote: > Hi, > > Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 > A5000? Must blow up to 256Kbit bog standard ST EPROMs. Did you try IFEL's web site ? I think they were selling one not so long ago <http://users.argonet.co.uk/ifel> (or there abouts) -- J�r�me Mathevet On Mon, 15 Dec 2003 01:10:31 -0000, "Chris Smith" <chris@FARPinfinitemonkeys.org.uk> wrote: >Hi, > >Does anyone know where I can get an EPROM programmer for a RISCOS 3.11 >A5000? Must blow up to 256Kbit bog standard ST EPROMs. What'd you be willing to pay ? John Kortink -- Email : kortink@inter.nl.net Homepage : http://www.inter.nl.net/users/J.Kortink ViewFinder, the high performance graphics card for RISC PC's : visit http://www.windfall.nl for more details and pricing. ...

JavaScript and RegEx not working on Safari...
I am using Regular Expressions and Javascript to validate a form, specifically I want to make sure that if they try to upload a file that it has a proper name w/ certain extensions (doc,pdf, rtf). The script works on IE and Mozilla but fails on Safari on the MacOSX. Here is my code.. // ok files with proper extension var reOKFiles = /^([a-zA-Z].*|[1-9].*)\.(doc|DOC|pdf|PDF|rtf|RTF)$/; //where i check for the file... if(window.document.myForm.myDocument.value != ""){ var fileStr = window.document.myForm.myDocument.value; if(!reOKFiles.test(fileStr)){ alert("Pleas...

Need good javascript tutorial for programmers
Hello folks -- I would like a JavaScript tutorial for programmers. By this I mean that I'd like to know the language "fundamentals" /first/ and then learn about the "web stuff". This is because I came accross some articles claiming that JavaScript is, in fact, quite full of interesting capabilities (closures, higher-order functions, anonymous funtions, even object can be supported as in OOP). Can anyone recommend me a tutorial that goes beyond the "Look! Ma! I put a pop-up window in here!"? I'm interested in this because of the Moz...

Tcl programmer with Excellent Javascript background in NYC
I am looking for a TCL programmer and Javascript Expert. If you live in New York, New Jersey area, drop me a note please ...

US-NJ: Mt Laurel-JSP/Javascript Programmer
************************************************************** JobCircle.com is a regional job board serving all industries and occupations in the PA, NJ, DE, NY, MD, and DC areas. We offer a regional job board, online learning, and regional job fair events for jobseekers who live in our areas of focus. To Learn More: Job Board: http://www.JobCircle.com?source=ng eLearning: http://www.JobCircle.com/courseware?source=ng Job Fairs: http://JobCircleJobFairs.com?source=ng ************************************************************** Job Title: JSP/Java...

regex =~ string or string =~ regex?
Sometime I saw you wrote regex =~ string, while sometime you wrote string =~ regex. What's their difference and what's the recommended way? Thanks. Jenn. On 01/04/2010 10:27 AM, Ruby Newbee wrote: > Sometime I saw you wrote regex =~ string, while sometime you wrote > string =~ regex. > What's their difference and what's the recommended way? Thanks. The first version invokes method Regexp#=~ and the second version invokes String#=~ - which happen to do roughly the same although I believe the second one to be a tad slower. I personally prefer the first form becau...

Manual for Acorn Desktop C (repost from c.s.a.programmer)
I've got one set of manuals - well I had the discs as well, but have disposed of them - for Acorn ANSI C release 4. I'm about to dispose of the manuals as well; unless somebody has a use for them. I'm after =A310 to cover carriage and handling. If nobody replies before 1pm, i'll be disposing of them via the trash... Dave ...

perl regex to java regex
I am trying to convert a piece of code from using perl regexes to using java regexes. I need some help with converting the following two PERL syntax regex's to java syntax regex's. Can anyone please help 1. FIRST_PERL_REGEX = "/^[\\d]*$/" 2. SECOND_PERL_REGEX = "/^[\\d]*/" (All I am trying to do in the above regex's is try to look for an integer) essentially I need the equivalent FIRST_JAVA_REGEX and SECOND_JAVA_REGEX for the above. "Rick Venter" <rick_venter@yahoo.com> wrote in message news:e6f6eb95.0310290901.38be6c02@posting.google.com.....

Non-Windows User/Non JavaScript programmer wants help
Hi, As I don't have Microsoft MPlayer for Linux (I believe there is none ;-) And I'm not very JavaScript literate, I could use help to determine if it is possible to figure out the actual URL of the asx file to some Linux streaming app to play the stream here at this site: http://tuner1.dc1.sonixtream.com/solon/media/tuner/Tuner?aff=fmtalki&useSame=true&type=IE As it looks to me, the script is using the MPlayer API to fetch the asx file and in principle it should be possible to give the asx file to Linux MPlayer (not an MS product) and it should be able to stream it; or the asx file should have the correct url. If you can help please post and maybe email to beagleATsmarttDOTcom. Thanks -- ....Dave Dawson "If you wrestle in the mud with a pig, you both get dirty, and the pig likes it." ...

Javascript and IE? Javascript and C#?
While my question might be simple, the environment around it is terribly messy and so I will try to keep this clear and simple by only including the relevant code - however, as I will soon suggest, I worry that the problem isnt in what would seem to be the relevant code but instead is lost somewhere in the do-and-donts of the peripheral code. So at the end, i'll try to include all the affected code and you can see if any of its actually relevant. I know there is a lot going on... sorry, but I tried to write this clearly. So here is what I imagine to be relevant. I'm working with a page that uses a very simple javascript function change the style of an <li> element (display=block;). The code is simple...which is why I cant understand my problem. This function is being called by <body onload="fop()"> // Javascript function function fop() { var dropDown = document.getElementById("region"); var firstName = dropDown.name; var fload = document.getElementById(firstName); fload.style.display = "block"; } // This is where it grabs the name value. "View Source" confrims the values work, (eg. name="ZHT") <select name="<%=Request.QueryString("lang")%>" id="region" onchange="selectMenu();"> //This is one of the <li> tags <li class="operatorLI" id="ZHT"> // Later for testing, I tried this (see below) <li class="op...

(S.O.S) Only 4 the best programmers. About Javascript & PHP
Hi: I have a problem: I've a page that sends an encrypted password, using MD5, to a PHP file, which is able to compare such MD5 encrypted password with an encryption stored on a data base. But the encryption way, on mD5, on JavaScript and PHP doesn't return the same value. My questions are: 1. Aren't these methods the same? I mean, the implementation on JavaScript and the implementation on PHP. 2. I could fix this by calling my .js file on my .php file. How can I do this? 3. Does anyone know about an encryption method that return the same value, on JavaScript and PHP? Thank's a lot. Alejo. Amilcar wrote: > Hi: > > I have a problem: > I've a page that sends an encrypted password, using MD5, to a PHP > file, which is able to compare such MD5 encrypted password with an > encryption stored on a data base. But the encryption way, on mD5, on > JavaScript and PHP doesn't return the same value. > My questions are: > 1. Aren't these methods the same? I mean, the implementation on > JavaScript and the implementation on PHP. > > 2. I could fix this by calling my .js file on my .php file. How can I > do this? > > 3. Does anyone know about an encryption method that return the same > value, on JavaScript and PHP? > > Thank's a lot. > > Alejo. Mmmmm what a heavenly way to make ...

HELP!! (VB.NET programmer trying to doe something useful with JavaScript)
Hello, I have a JavaScript function to "jump" from one column to the next for forms with large amounts of controls (code below). The code does work, but it overrides the <Enter> key, which normally submits the form. How can I handle the keys while allowing the <Enter> key to still work? Thank you, Eric \\\ function JumpColumns() { // The <Ctrl> key was pressed. if (window.event.ctrlKey) { // '[' (left) was pressed. if (window.event.keyCode == 221) { // code to jump left // ']' (right) was pressed. } else if (window.event.keyCo...

JavaScript
Guys, anybody know if is possible "to press" a button linked a javascript function using python? My Firefox send something like that: POST /msgs.aspx TOKEN=B8B83BGDBC191B9FE0A0BE1393294FAB&sig=gpaiOqbp0Nr %2BoecRLF4FGGDOAao %3D&toUserId=1331299&rawAddedDate=1188546666&fromUserId=23029&Action.delete=Send +data python has modules for forms and other things... and for it? Thank you for help... zowtar >python has modules for forms and other things... and for it? Check out httplib and urlib2, it might be useful for you. Hi! I know "how to", but o...

sys
computer common oriented http://www.freewebs.com/buildem/ http://amigos.com/go/g904313-pmem ...

regex
Hi for everyone, i need to parse a text and i need to found a text like this: <objInformation name="<%=Property.name%> version="1"> I try to parse this with this pattern but don't work: <objInformation(\s+\w+\s*=\s*([(["|']?<\s*%\s*=\s*Property.\w+\s*%\s*>["|']?) |(["|']?\w+["|']?)]))*> Anybody what is wrong in this regular expresion? Thanks, Alejandro "a_narancio@hotmail.com (Alejandro Narancio)" wrote in comp.lang.java: > Hi for everyone, i need to parse a text and i need to fo...

sys
Is it OT here to talk about IPC and pipes? Or are all aspects of kernle programming ok here? Bill Bill Cunningham <nospam@nspam.com> wrote: > Is it OT here to talk about IPC and pipes? Or are all aspects of kernle > programming ok here? If you want to discuss how IPC and pipes are implemented in the kernel it's completely ok. But if you're interested in how to use IPC or pipes from a userland program then posting to e.g. comp.unix.programmer or comp.os.linux.development.apps will probably make a lot more sense. R...

Web resources about - regex in javascript - comp.sys.acorn.programmer

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

JavaScript - Wikipedia, the free encyclopedia
programming styles. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
... editor - report abuse/spam - help the entire directory only in Tools/Obfuscators Description Top : Computers : Programming : Languages : JavaScript ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript
The Facebook SDK for JavaScript provides a rich set of client-side functionality for adding Social Plugins, making API calls and implementing ...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 3/25/2016 11:22:50 AM