TWiT Throwback (Audio)

Coding 101 24: Perl: Command Line Search and Replace


Listen Later

The Code for today's show is available at our: Github

Ivory Tower

We learned in the last episode that "Regular Expressions" or "RegEx" is just another way of saying, "find a pattern"

We learned that we can use RegEx to search a string for that pattern according to a set of parameters and modifiers that WE determine

The usage of RegEx is as Follows:

$nameofstring =~ (Match Operator) / (expression) / (expression) / (Match Expression Operator)

Which means:

$nameofstring =~ (action to take)/(pattern to match)/(pattern to replace match with)/(how to search)

Useful Match Operators

  • m/ Match Regular Expression
  • s/ Substitite Regular Expression
  • tr/ Tranliterate Regular expression
  • Useful Match Operator Modifiers

    • g Match globally, find ALL occurences
    • i case insensitive
    • m treat string as multiple lines
    • o Evaluate the expression only once
    • s treat string as single line
    • x Use extended regular expressions (Allows you to use white space in the expression)
    • Hosts: Fr. Robert Ballecer, SJ and Shannon Morse

      Guest: Patrick Delahanty

      Get in Touch With Us!
      • Subscribe and get Coding 101 automatically at https://twit.tv/shows/coding-101!
      • Follow PadreSJ and Snubs on Twitter
      • Bandwidth for Coding 101 is provided by CacheFly.

        ...more
        View all episodesView all episodes
        Download on the App Store

        TWiT Throwback (Audio)By TWiT

        • 4
        • 4
        • 4
        • 4
        • 4

        4

        4 ratings


        More shows like TWiT Throwback (Audio)

        View all
        Total Leo (Audio) by TWiT

        Total Leo (Audio)

        202 Listeners

        TWiT News (Audio) by TWiT

        TWiT News (Audio)

        78 Listeners

        All TWiT.tv Shows (Audio) by TWiT

        All TWiT.tv Shows (Audio)

        355 Listeners

        TWiT Events (Audio) by TWiT

        TWiT Events (Audio)

        8 Listeners

        Total Mikah (Audio) by TWiT

        Total Mikah (Audio)

        3 Listeners

        Untitled Linux Show (Audio) by TWiT

        Untitled Linux Show (Audio)

        7 Listeners

        Host-Read Ads (Audio) by TWiT

        Host-Read Ads (Audio)

        3 Listeners