Basic HTML version of Foils prepared Sept 20 97

Foil 48 More Substitution Examples

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


1 In code, replace an array subscript [...] with [n++]
2 Search: \[[^]]+\]
3 Replace: [n++]
4 PERL: s/\[[^]]+\]/[n++]/g
5 In an HTML doc, replace certain file references in URLs
6 Search: ys97_(\d\d)/
7 Replace: ys97_\1/index.html
8 PERL: s#ys97_(\d\d)/#ys97_\1/index.html#
9 Again in an HTML doc, replace certain paths in URLs
10 Search: ([^/])\.\./graphics
11 Replace: \1../../latex-graphics
12 PERL: s%([^/])\.\./graphics%\1../../latex-graphics%

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997