iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Perl with cheese...
    123,717

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Matching with a Regular Expression, REGEX, in Perl

    Matching with a Regular Expression, REGEX, in Perl



    You have a variable named $jiji that contains a sentence.

    $jiji="I see London.";

    You test the variable $jiji for the word london

    if ($jiji =~ m/london/i) {
    print "Matches!";
    }
    else {
    print "Doesn't Match!";
    }


    NOTES:
    -The i at the end of /london/i makes the match pattern case-insensitive. Remove the i to make match case-sensitive.

    Copy and Paste Perl Code:


    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    $jiji="I see London.";

    if ($jiji =~ m/london/i) {
    print "Matches!";
    }
    else {
    print "Doesn't Match!";
    }

    exit;


    Resources:
    Getting What is Matched in Perl


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: OPEN and READ a Data File in Perl
    Next Article: OPEN and WRITE a Data File in Perl





    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    HTMLHTML

    Gary B. Shelly, Th...

    New $84.55

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39


    Of Interest:
  • Matching at the Beginning and End 2
  • Splitting an ARRAY in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • Delete a File Using unlink in Perl
  • Environmental Variables Available in Javascript using Navigator Object
  • Change a Form Field with Javascript
  • Javascript Push - Use Push on an Array in Javascript
  • Javascript Superscript Text
  • HTML Tables
  • HTML Codes
  • Make Strikethrough Text Using HTML
  • HTML Frames

  • More Articles:
  • Add to the Beginning of an Array with Unshift in Perl
  • OPEN and WRITE a Data File in Perl
  • Making a Directory Using mkdir in Perl
  • Getting Server Time in Perl
  • onClick Javascript
  • Call your Function in Javascript
  • Use OnMouseOver in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • Write a For Loop in Javascript
  • HTML Title Tag
  • HTML Background
  • Make a Line Return Using HTML
  • HTML Forms

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,478
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:16 EDT