Regular Expression (regex) - Forsiden
[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
- python re replace example
- programming principles in python csci 503 490
- ldope python re projection tool v1 0 nasa
- regexing in sas for pattern matching and replacement
- python string replace tutorial kart
- python regex cheatsheet activestate
- python guide documentation read the docs
- python regular expressions university of cambridge
- ppyytthhoonn rreegguullaarr eexxpprreessssiioonnss
- python regular expressions dataquest
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