Regular Expression (regex) - Universitetet i Oslo
[Pages:44]Regular Expression (regex)
Jonathan Feinberg Dept. of Informatics, Univ. of Oslo
Simula Research Laboratory
August 2014
Regular expression (regex)
Regular expression (regex) ? p.1
Contents
Motivation for regular expression Regular expression syntax Lots of examples on problem solving with regular expressions For more information on regex in Python:
doc/texts/pub/pyregex.html
Regular expression (regex) ? p.2
Digression: Editor war!
Digression: Editor war! ? p.3
Regular expression is advanced search and replace
It is strongly ecourage to learn by experimenting in a supported editor.
Emacs
?q=emacs+tutorial
Vim
$ sudo apt-get install vim-gnome # or vim-gtk or vim-common
$ vimtutor
# 30 minutes to learn basic stuff
Sublime
Notepad++ (Windows)
textmate (Mac)
Digression: Editor war! ? p.4
Regex search and replace in Emacs and Vim
Emacs search:
C-M-s
M-x isearch-forward-regex
Emacs replace:
C-M-%
M-x replace-regexp
# [y]es/[n]o/all[!]/cancel[]
Vim highlighting:
:set hls
:set hlsearch
Vim search:
/\v
Vim replace:
:%s/\v
Digression: Editor war! ? p.5
Show and tell
Show and tell ? p.6
The command line wild card
Consider a simulation code with this type of output:
$ ls *.tex report.tex
Here '*' is a wild card and can be read as: "Zero or more of any non-linefeed character type". Simple and powerful, but some what unrefined.
Show and tell ? p.7
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- lecture 18 regular expressions cmu school of computer science
- regular expressions cmu school of computer science
- python regex cheatsheet activestate
- regular expression regex universitetet i oslo
- regexing in sas for pattern matching and replacement
- chapter regular expressions text normalization edit distance
- 043 29 an introduction to regular expressions with examples
- regular expressions the complete tutorial github pages
- lecture 18 theory of computation regular expressions and dfas
- 10 searching in lancsbox lancaster university
Related searches
- javascript regular expression match
- regular expression in java
- regular expression in java tutorial
- java regular expression example
- regular expression interactive tutorial
- javascript regular expression replace
- regular expression blank
- regular expression remove blank lines
- regular expression case insensitive match
- regular expression empty line
- regular expression special character
- regular expression remove special characters