Subversion Repositories wimsdev

Rev

Rev 5921 | Rev 11212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5921 Rev 11210
Line 1... Line 1...
1
!! +exec+ +var+ +string+
1
!! +exec+ +var+ +string+
2
$lst_tit replace$lst_titend$type_both
2
tit:replace
3
  $(lst_syntax)replace [internal] $emph s1 $emphend by $emph s2 $emphend in $emph
-
 
4
  string$emphend<br/>
3
type:$type_both
5
  </span>or <span class="tt">!replace $emph obj$emphend $emph ident$emphend by
4
syntax:!replace [internal] `s1' by `s2' in `string'<br/>\
6
  $emph s$emphend in $emph string$emphend</span>
5
  or <span class="tt">!replace `obj' `ident' by `s' in `string'</span>
7
  $lst_mean String manipulation. <p>
6
mean:String manipulation. <p>\
8
  Under the first syntax, variable substitution is first done on
7
  Under the first syntax, variable substitution is first done on `string'.\
9
  $emph string$emphend. Then all occurences of substring $emph s1$emphend
8
  Then all occurences of substring `s1' are replaced by `s2'. <br/>\
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,
9
  When the keyword `internal' is absent, the Linux utility `sed' is called to make the replacements,\
13
  therefore regular expressions are accepted in $emph s1$emphend and
10
  therefore regular expressions are accepted in `s1' and `s2'.\
14
  $emph s2$emphend. Please refer to the man page of $emph sed$emphend for
11
  Please refer to the man page of `sed' for details. </p><p>\
15
  details. </p><p>
-
 
16
  Under the second syntax, $emph obj$emphend can be $emph char$emphend,
12
  Under the second syntax, `obj' can be `char', `word', `item' or `line'.\
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
13
  Then the word, item or line identified by `ident' in `string' is replaced\
20
  by $emph s$emphend, after variable substitutions. <br/>
14
  by `s', after variable substitutions. <br/>\
21
  $emph ident$emphend can be a string, in this case all objects
15
  `ident' can be a string, in this case all objects (words, items or lines) matching `ident' \
22
  (words, items or lines) matching
-
 
23
  $emph ident$emphend will be replaced. It can also be a number (positive or
16
  will be replaced. It can also be a number (positive or negative integer `n'), preceded\
24
  negative integer $emph n$emphend), preceded
-
 
25
  by the word $emph number$emphend. In this case the object
17
  by the word `number'. In this case the object number `n' will be replaced.\
26
  number $emph n$emphend will be replaced. (In the case where n&lt;0,
-
 
27
  it is the last -n'th object which is replaced.)
18
  (In the case where n&lt;0, it is the last -n'th object which is replaced.)\
28
  </p>
19
  </p>