Scripting Paradigm Hallmarks

  • Dynamically typed / untyped and scope
  • Interpreted
  • Regular expression support
  • Easy string processing
  • Cross-platform

Regular Expression

  • Escape character: \
  • Basic:
  • Idea Regex Example Matched Strings
    or a|b "a", "b"
    concatenation ab "ab"
    repetition a* "", "a", "aa", "aaa", ...

Regular Expression

  • Unix extras:
  • Idea Regex Example Matched Strings
    grouping () (ab)|(cd) "ab", "cd"
    one or more a+ "a", "aa", "aaa", ...
    zero or one a? "", "a"
    anything excepts newline . "A", " ", "3", "$", ...
    empty string (in formal definition: ε) ^$ ""
    set [azAZ12] "a", "z", "A", "Z", "1", "2"
    range [a-zA-Z0-9] "B", "u", "4", ...
    not [^a] "B", "b", "3", "$", ...
    reserved/escaped \+; \*; \d "+"; "*"; "0", "1", ..., "9"

Regular Expression

  • More:
  • Idea Regex Example Matched Strings
    how many a{3} "aaa"
    range of repetition a{3,5} "aaa", "aaaa", "aaaaa"