CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    1

    Javascript Help: what does this line do

    Hi

    I am new to JS and wanted some help. I have a script which accepts values in the format of username.number and returns the details of username.number from a database. Now the script only works for username that is alphabetical and not alphanumeric. Thus when the username is alphanumeric the search doesn't return any values. I have identified with my limited Javascript skills that the following line is the one because of which the alphanumeric value is not recognized. Is that a correct assumption? So if I add 0-9 next to A-Z will that solve the issue? If only I knew what this line did, it will be great. Any help is greatly appreciated. Thanks

    if( $entry ne "" && $entry !~ /\;/ && $entry !~ / / && $entry =~ /[a-zA-Z]+\.[0-9]+/ )

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,271

    Re: Javascript Help: what does this line do

    Welcome to the forums

    What you are having issues with, is called Regular Expressions.

    I am including some links here which you may find useful.

    http://www.javascriptkit.com/javatutors/re.shtml

    http://www.javascriptkit.com/javatutors/redev2.shtml

    http://www.evolt.org/article/Regular...ript/17/36435/

    http://www.webreference.com/js/column5/

    http://www.devarticles.com/c/a/JavaS...in-JavaScript/

    http://www.learn-javascript-tutorial...xpressions.cfm

    http://articles.sitepoint.com/articl...ons-javascript

    http://lawrence.ecorp.net/inet/samples/regexp-intro.php

    http://www.ehow.com/how_6557774_regu...-tutorial.html

    http://www.trans4mind.com/personal_d...le%20Usage.htm

    http://javascript.about.com/od/regul...xpressions.htm

    http://eloquentjavascript.net/chapter10.html

    http://www.zytrax.com/tech/web/regex.htm

    http://www.captain.at/howto-javascri...expression.php

    http://richardbowles.tripod.com/java...1/lesson11.htm

    http://www.greggriffiths.org/webdev/...gex/index.html

    http://articles.techrepublic.com.com...1-1049625.html

    http://www.9lessons.info/2009/03/per...alidation.html

    http://www.devsource.com/c/a/Using-V...in-JavaScript/

    http://www.thespanner.co.uk/2008/02/...r-expressions/

    http://www.freenetpages.co.uk/hp/ala...d/tutregex.htm

    http://www.hunlock.com/blogs/An_Intr..._in_Javascript

    http://www.go4expert.com/forums/showthread.php?t=2262

    http://net.tutsplus.com/tutorials/ja...r-expressions/

    http://articles.sitepoint.com/print/...ons-javascript

    http://www.explainth.at/en/re/specat.shtml

    http://haacked.com/archive/2004/10/2...matchhtml.aspx

    http://www.sislands.com/coin70/week5/regexp.htm

    http://www.roseindia.net/javascript/...ressions.shtml

    http://social.msdn.microsoft.com/For...6-801d71245363

    http://docs.sun.com/source/816-6408-10/regexp.htm

    http://fyneworks.blogspot.com/2007/0...ssions-in.html

    http://www.alperguc.com/en/regular-e...avascript.html

    http://javascript.internet.com/snipp...ns-taster.html

    http://javascriptweblog.wordpress.co...ipt-regex-api/

    http://www.dailycoding.com/Posts/usi...avascript.aspx

    http://newsourcemedia.com/blog/javas...racters-regex/

    http://websitetips.com/regex/

    http://networking.mydesigntool.com/v...?tid=411&id=31

    http://www.scottklarr.com/topic/103/...-cheat-sheets/

    http://ntt.cc/2008/05/10/over-10-use...fficiency.html

    http://www.regextester.com/jssyntax.html

    http://www.codinghorror.com/blog/200...pressions.html

    http://www.webreference.com/js/column5/define.html

    http://freewebdesigntutorials.com/ja...xpressions.htm

    http://www.builderau.com.au/program/...9271245,00.htm

    http://3dmdesign.com/development/int...-in-javascript

    http://www.acrobatusers.com/tutorial...ar-expressions

    http://www.codetoad.com/asp_email_reg_exp.asp

    http://www.regexbuddy.com/create.html

    http://simonwillison.net/2010/Jul/4/escaping/

    http://lawrence.ecorp.net/inet/sampl...exp-format.php

    http://4umi.com/web/javascript/regex.php

    http://www.webdeveloper.com/forum/sh...ad.php?t=73975

    http://www.dustindiaz.com/regular-ex...back-matching/

    http://en.wikibooks.org/wiki/JavaScr...ar_Expressions

    http://www.smashingmagazine.com/2009...r-expressions/

    http://www.prototypejs.org/api/string

    http://www.breakingpar.com/bkp/home....256C0C0062AC78

    http://en.wikipedia.org/wiki/Regular_expression

    http://javascript.about.com/library/blre.htm

    http://www.diveintojavascript.com/ar...-in-javascript

    http://gabrieljones.com/working-with...in-javascript/

    http://blog.strictly-software.com/20...pressions.html

    http://www.xul.fr/javascript/tutoria...expression.php

    http://www.helium.com/items/1365463-...ion-javascript

    http://www.peterbe.com/plog/regular-...-in-javascript

    http://www.devx.com/tips/Tip/35130

    http://www.skill-guru.com/test/53/Re...ascript-Part-1

    http://www.webmasterworld.com/javascript/3410705.htm

    http://www.deitel.com/ResourceCenter...9/Default.aspx

    http://www.java2s.com/Tutorial/JavaS...datetheURL.htm

    http://snippets.dzone.com/posts/show/597

    http://www.tipstrs.com/tip/4645/Matc...lar-expression

    http://it.toolbox.com/wiki/index.php...ing_JavaScript

    http://www.visualbasicscript.com/Com...pt-m68589.aspx

    http://www.newthinktank.com/2010/04/...torial-part-3/

    http://www.kbcafe.com/csharp/?guid=20060628101231

    http://osix.net/modules/article/?id=635

    http://www.mobilefish.com/tutorials/...ide_regex.html

    http://www.w3schools.com/js/js_obj_regexp.asp

    http://home.cogeco.ca/~ve3ll/jstutorf.htm

    http://www.marketingtechblog.com/pro...word-strength/

    http://snipplr.com/view/26466/extrac...cript--jquery/

    http://stevenbenner.com/2010/03/java...nto-an-object/

    http://james.padolsey.com/javascript...script-part-2/

    http://blogs.adobe.com/formfeed/2009...xpression.html

    http://www.xploredotnet.com/2007/08/...ing-using.html

    http://phplens.com/lens/ex/ex301.php

    http://p2p.wrox.com/book-beginning-r...new-regex.html

    http://joeyjavas.com/category/progra...r-expressions/

    http://hungred.com/useful-informatio...ar-expression/

    http://www.regexguru.com/

    http://help.dottoro.com/ljarccdp.php

    http://www.yaldex.com/javascript_tut...2/LiB0055.html

    http://www.xaprb.com/blog/2006/01/18...ssion-toolkit/

    http://www.zdnetasia.com/data-valida...s-61956945.htm

    http://www.seeingwithc.org/topic7html.html

    http://www.tutorialspoint.com/javasc...exp_object.htm

    http://crynobone.com/3-javascript-re...-for-malaysia/

    http://www.codehouse.com/javascript/articles/substring/

    http://www.jibbering.com/faq/notes/type-conversion/

    http://www.dotnetspider.com/resource...avaScript.aspx

    http://regexadvice.com/tags/javascri...s/default.aspx

    http://www.acqal.com/blog/a/article/...ching-strings/

    http://www.tizag.com/javascriptT/jav...ing-search.php

    http://www.klauskomenda.com/code/reg...ical-examples/

    http://www.cyber-reality.com/regexy.html

    http://www.bennadel.com/blog/1917-Ja...urns-In-IE.htm

    http://www.the-art-of-web.com/javascript/validate/1/

    http://www.odesk.com/jobs/JavaScript...214047bac53150

    http://www.greggriffiths.org/webdev/...ylooklike.html

    Hannes
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  3. #3
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,943

    Re: Javascript Help: what does this line do

    Welcome to the forums, sinfuldips!

    I have not doubt that you are new to JavaScript...especially since the code you posted is not even JavaScript. Can you please confirm with what language you are actually working?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    Jul 2021
    Posts
    1

    Re: Javascript Help: what does this line do

    Quote Originally Posted by HanneSThEGreaT View Post
    Welcome to the forums

    What you are having issues with, is called Regular Expressions.

    I am including some links here which you may find useful.

    http://www.javascriptkit.com/javatutors/re.shtml

    http://www.javascriptkit.com/javatutors/redev2.shtml

    http://www.evolt.org/article/Regular...ript/17/36435/

    http://www.webreference.com/js/column5/

    http://www.devarticles.com/c/a/JavaS...in-JavaScript/

    http://www.learn-javascript-tutorial...xpressions.cfm

    http://articles.sitepoint.com/articl...ons-javascript

    http://lawrence.ecorp.net/inet/samples/regexp-intro.php

    http://www.ehow.com/how_6557774_regu...-tutorial.html

    http://www.trans4mind.com/personal_d...le%20Usage.htm

    http://javascript.about.com/od/regul...xpressions.htm

    http://eloquentjavascript.net/chapter10.html

    http://www.zytrax.com/tech/web/regex.htm

    http://www.captain.at/howto-javascri...expression.php

    http://richardbowles.tripod.com/java...1/lesson11.htm

    http://www.greggriffiths.org/webdev/...gex/index.html

    http://articles.techrepublic.com.com...1-1049625.html

    http://www.9lessons.info/2009/03/per...alidation.html

    http://www.devsource.com/c/a/Using-V...in-JavaScript/

    http://www.thespanner.co.uk/2008/02/...r-expressions/

    http://www.freenetpages.co.uk/hp/ala...d/tutregex.htm

    http://www.hunlock.com/blogs/An_Intr..._in_Javascript

    http://www.go4expert.com/forums/showthread.php?t=2262

    http://net.tutsplus.com/tutorials/ja...r-expressions/

    http://articles.sitepoint.com/print/...ons-javascript

    http://www.explainth.at/en/re/specat.shtml

    http://haacked.com/archive/2004/10/2...matchhtml.aspx

    http://www.sislands.com/coin70/week5/regexp.htm

    http://www.roseindia.net/javascript/...ressions.shtml

    http://social.msdn.microsoft.com/For...6-801d71245363

    http://docs.sun.com/source/816-6408-10/regexp.htm

    http://fyneworks.blogspot.com/2007/0...ssions-in.html

    http://www.alperguc.com/en/regular-e...avascript.html

    http://javascript.internet.com/snipp...ns-taster.html

    http://javascriptweblog.wordpress.co...ipt-regex-api/

    http://www.dailycoding.com/Posts/usi...avascript.aspx

    http://newsourcemedia.com/blog/javas...racters-regex/

    http://websitetips.com/regex/

    http://networking.mydesigntool.com/v...?tid=411&id=31

    http://www.scottklarr.com/topic/103/...-cheat-sheets/

    http://ntt.cc/2008/05/10/over-10-use...fficiency.html

    http://www.regextester.com/jssyntax.html

    http://www.codinghorror.com/blog/200...pressions.html

    http://www.webreference.com/js/column5/define.html

    http://freewebdesigntutorials.com/ja...xpressions.htm

    http://www.builderau.com.au/program/...9271245,00.htm

    http://3dmdesign.com/development/int...-in-javascript

    http://www.acrobatusers.com/tutorial...ar-expressions

    http://www.codetoad.com/asp_email_reg_exp.asp

    http://www.regexbuddy.com/create.html

    http://simonwillison.net/2010/Jul/4/escaping/

    http://lawrence.ecorp.net/inet/sampl...exp-format.php

    http://4umi.com/web/javascript/regex.php

    http://www.webdeveloper.com/forum/sh...ad.php?t=73975

    http://www.dustindiaz.com/regular-ex...back-matching/

    http://en.wikibooks.org/wiki/JavaScr...ar_Expressions

    http://www.smashingmagazine.com/2009...r-expressions/

    http://www.prototypejs.org/api/string

    http://www.breakingpar.com/bkp/home....256C0C0062AC78

    http://en.wikipedia.org/wiki/Regular_expression

    http://javascript.about.com/library/blre.htm

    http://www.diveintojavascript.com/ar...-in-javascript

    http://gabrieljones.com/working-with...in-javascript/

    http://blog.strictly-software.com/20...pressions.html

    http://www.xul.fr/javascript/tutoria...expression.php

    http://www.helium.com/items/1365463-...ion-javascript

    http://www.peterbe.com/plog/regular-...-in-javascript

    http://www.devx.com/tips/Tip/35130

    http://www.skill-guru.com/test/53/Re...ascript-Part-1

    http://www.webmasterworld.com/javascript/3410705.htm

    http://www.deitel.com/ResourceCenter...9/Default.aspx

    http://www.java2s.com/Tutorial/JavaS...datetheURL.htm

    http://snippets.dzone.com/posts/show/597

    http://www.tipstrs.com/tip/4645/Matc...lar-expression

    http://it.toolbox.com/wiki/index.php...ing_JavaScript

    http://www.visualbasicscript.com/Com...pt-m68589.aspx

    http://www.newthinktank.com/2010/04/...torial-part-3/

    http://www.kbcafe.com/csharp/?guid=20060628101231

    http://osix.net/modules/article/?id=635

    http://www.mobilefish.com/tutorials/...ide_regex.html

    http://www.w3schools.com/js/js_obj_regexp.asp

    http://home.cogeco.ca/~ve3ll/jstutorf.htm

    http://www.marketingtechblog.com/pro...word-strength/

    http://snipplr.com/view/26466/extrac...cript--jquery/

    http://stevenbenner.com/2010/03/java...nto-an-object/

    http://james.padolsey.com/javascript...script-part-2/

    http://blogs.adobe.com/formfeed/2009...xpression.html

    http://www.xploredotnet.com/2007/08/...ing-using.html

    http://phplens.com/lens/ex/ex301.php

    http://p2p.wrox.com/book-beginning-r...new-regex.html

    http://joeyjavas.com/category/progra...r-expressions/

    http://hungred.com/useful-informatio...ar-expression/

    http://www.regexguru.com/
    https://sauditourguide.com

    http://help.dottoro.com/ljarccdp.php

    http://www.yaldex.com/javascript_tut...2/LiB0055.html

    http://www.xaprb.com/blog/2006/01/18...ssion-toolkit/

    http://www.zdnetasia.com/data-valida...s-61956945.htm

    http://www.seeingwithc.org/topic7html.html

    http://www.tutorialspoint.com/javasc...exp_object.htm

    http://crynobone.com/3-javascript-re...-for-malaysia/
    https://morjanah.com/nasayih/

    https://morjanah.com
    https://sauditourguide.com
    https://al-jazirah.org
    http://uacc-ksa.com

    http://www.codehouse.com/javascript/articles/substring/

    http://www.jibbering.com/faq/notes/type-conversion/

    http://www.dotnetspider.com/resource...avaScript.aspx

    http://regexadvice.com/tags/javascri...s/default.aspx

    http://www.acqal.com/blog/a/article/...ching-strings/

    http://www.tizag.com/javascriptT/jav...ing-search.php

    http://www.klauskomenda.com/code/reg...ical-examples/

    http://www.cyber-reality.com/regexy.html

    http://www.bennadel.com/blog/1917-Ja...urns-In-IE.htm

    http://www.the-art-of-web.com/javascript/validate/1/

    http://www.odesk.com/jobs/JavaScript...214047bac53150

    http://www.greggriffiths.org/webdev/...ylooklike.html

    Hannes
    sir i want to tell u
    big thank u

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured