Rev 4562 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
32 | reyssat | 1 | !! +exec+ +var+ +string+ |
2 | $lst_tit replace$lst_titend$type_both |
||
3 | $(lst_syntax)replace [internal] $emph s1 $emphend by $emph s2 $emphend in $emph |
||
4 | string$emphend<br> |
||
5 | </tt>or <tt>!replace $emph obj$emphend $emph ident$emphend by |
||
6 | $emph s$emphend in $emph string$emphend</tt> <br> |
||
7 | $lst_mean String manipulation. <p> |
||
8 | Under the first syntax, variable substitution is first done on |
||
9 | $emph string$emphend. Then all occurences of substring $emph s1$emphend |
||
10 | are replaced by $emph s2$emphend. <br> |
||
11 | When the keyword $emph internal $emphend is absent, |
||
12 | the Linux utility $emph sed$emphend is called to make the replacements, |
||
13 | therefore regular expressions are accepted in $emph s1$emphend and |
||
14 | $emph s2$emphend. Please refer to the man page of $emph sed$emphend for |
||
15 | details. <p> |
||
16 | Under the second syntax, $emph obj$emphend can be $emph char$emphend, |
||
17 | $emph word$emphend, |
||
18 | $emph item$emphend or $emph line$emphend. Then the word, item or line |
||
19 | identified by $emph ident$emphend in $emph string$emphend is replaced |
||
20 | by $emph s$emphend, after variable substitutions. <br> |
||
21 | $emph ident$emphend can be a string, in this case all objects |
||
22 | (words, items or lines) matching |
||
23 | $emph ident$emphend will be replaced. It can also be a number (positive or |
||
24 | negative integer $emph n$emphend), preceded |
||
25 | by the word $emph number$emphend. In this case the object |
||
26 | number $emph n$emphend will be replaced. (In the case where n<0, |
||
27 | it is the last -n'th object which is replaced.) |
||
28 | |||
29 | |||
30 |