Results 1 to 3 of 3

Thread: JavaScript: RegExp and Boolean objective

  1. #1
    RussellBarnes is offline Senior Member
    Join Date
    Dec 2009
    Posts
    214
    Rep Power
    3

    Default JavaScript: RegExp and Boolean objective

    I am started learning JavaScript. I don’t have very well knowledge of JavaScript. I want to know about the JavaScript objects: RegExp Object and Boolean Object. Can anybody explain to me in detail info about these objects with examples. Thanks in advanced.

  2. #2
    PetersonClark is offline Senior Member
    Join Date
    Dec 2009
    Posts
    202
    Rep Power
    3

    Default

    There are three methods in the J-Script RegExp Object. They are:

    • exec().
    • test().
    • compile().

    1. If you try to find a string type in a particular value and return it then you may use the exec () method which will give a null value if the string type is not found.

    2. If you try to find a string pattern from a given value than the test () method is useful. This method will give false/true values.

    3. If you want to change the RegExp you may use the compile() method of Regular Expression in J-Script.

  3. #3
    CollinsBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    213
    Rep Power
    3

    Default

    Example for compile () of RegExp:

    Code:
    var srh =new RegExp("w");
    document.write(srh.test("Hello World"));
    srh.compile("t");
    document.write(srh.test("Hello World"));
    Example for test () of RegExp:

    Code:
    var srh=new RegExp("f");
    document.write(srh.test("Hi eveyone"));
    JavaScript has a Regular Expressions to match the patterns in a text contained in a text box.

Similar Threads

  1. What is Javascript?
    By Brownchris in forum Programming
    Replies: 1
    Last Post: 04-22-2010, 03:56 PM
  2. Adobe will reinstate Microsoft as hacker's objective
    By Elliot Peterson in forum Latest Hardware News
    Replies: 1
    Last Post: 01-02-2010, 06:02 AM
  3. More interesting conditions using boolean operators in C++
    By Franklin Macallum in forum Programming
    Replies: 0
    Last Post: 10-01-2009, 11:26 AM
  4. Can I Search Folders using Boolean operands?
    By Joselyn D'lima in forum Windows 7/2000/NT
    Replies: 1
    Last Post: 05-12-2009, 10:31 AM
  5. Boolean
    By techno23 in forum Programming
    Replies: 0
    Last Post: 03-26-2008, 11:01 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48