4 regex enumerables

35
Class 4 Regular Expressions & Enumerables

Upload: liahhansen

Post on 10-Jun-2015

975 views

Category:

Technology


0 download

TRANSCRIPT

  • 1. Class 4
    Regular Expressions & Enumerables

2. Regular Expressions
/regex will find me/
3. What are Regular Expressions
Regular expressions allow matching and manipulation of textual data.
Abbreviated as regex or regexp, or alternatively, just patterns
4. What are Regular Expressions For?
Scan a string for multiple occurrences of a pattern.
Replace part of a string with another string.
Split a string based on a matching separator.
5. Regular Expressions in Ruby

  • Regular expressions are put between two forward slashes (/match_me/)

6. They are escaped with a backward slash ().