User Tools

Site Tools


msar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
msar [2014/10/27 09:31]
caf [Synopsis:]
msar [2014/10/27 09:40] (current)
caf Correct description of 'i' flag and add description of 'c' flag.
Line 1: Line 1:
-# $EPIC: msar.txt,v 1.2 2006/08/01 05:15:58 sthalik Exp $ 
 ======Synopsis:​====== ======Synopsis:​======
 $__msar__([c][i][g][r]/​[<​search>/<​replace>/​]*<​text>​) $__msar__([c][i][g][r]/​[<​search>/<​replace>/​]*<​text>​)
  
 ======Technical:​====== ======Technical:​======
-   ​* ​The arguments are composed of: +The arguments are composed of: 
-     - zero or more of the options '​i',​ '​g',​ and '​r',​ +     - zero or more of the options ​''​c'',​ ''i'', ​''g'', and ''r'', 
-     - a delimiter which can be any character other than '​i',​ '​g',​ or '​r',​ and is customarily a forward-slash,​+     - a delimiter which can be any character other than ''​c'',​ ''i'', ​''g'', or ''r'', and is customarily a forward-slash,​
      - ZERO OR MORE SETS OF SUBSTITUTIONS:​      - ZERO OR MORE SETS OF SUBSTITUTIONS:​
-       * some text ("<​search>​") that may not contain the delimiter to be removed,+       * some text (''​<​search>​''​) that may not contain the delimiter to be removed,
        * a delimiter; the same as (2),        * a delimiter; the same as (2),
-       * some text ("<​replace>​") that may not contain the delimiter to be inserted in place of (3a),+       * some text (''​<​replace>​''​) that may not contain the delimiter to be inserted in place of (3a),
        * a delimiter; the same as (2),        * a delimiter; the same as (2),
-     - a string of text ("<​text>​") that MAY NOT contain the delimiter to be transformed.+     - a string of text (''​<​text>​''​) that MAY NOT contain the delimiter to be transformed.
  
-No matter what, <​text>​ is always the text that follows the final delimiter.+No matter what, ''​<​text>​'' ​is always the text that follows the final delimiter.
 If properly formed, there should always be an odd number of delimiters in If properly formed, there should always be an odd number of delimiters in
 the arguments. ​ But if there is an even number of delimiters, this would the arguments. ​ But if there is an even number of delimiters, this would
-result in a substutition with a <​search>​ but no <​replace>​. ​ This <​search>​+result in a substutition with a ''​<​search>​'' ​but no ''​<​replace>​''​.  This ''​<​search>​''​
 would be ignored as a syntax error. would be ignored as a syntax error.
  
-In its simple form, the string <​text>​ is returned with the first instance +In its simple form, the string ​''​<​text>​'' ​is returned with the first instance 
-of each of the <​search>​ strings replaced with each of the corresponding +of each of the ''​<​search>​'' ​strings replaced with each of the corresponding 
-<​replace>​ strings. ​ The search ​of <​search>​ is case insensitive.+''​<​replace>​'' ​strings. ​ The matching ​of ''​<​search>​'' ​is case-insensitive ​by default.
  
 The options modify this behavior: The options modify this behavior:
  
-|     | The search for <​search>​ should be case sensitive. ​               | +|   ''​c'' ​  | The search for ''​<​search>​'' ​should be case-sensitive. ​               | 
-|   ​g ​  | All instances of <​search>​ should be replaced with <​replace>​. You must be careful that the contents of <​replace>​ do not match <​search>​ because this would cause it to be infinitely replaced. ​ | +|   ''​i'' ​  | The search for ''<​search>''​ should be case-insensitive (this is the default, and the option is only included for backwards-compatibility). ​               | 
-|   ​r ​  | The <​text>​ argument is a variable ​that should be substituted   | +|   ''​g'' ​  | All instances of ''​<​search>​'' ​should be replaced with ''​<​replace>​''​. You must be careful that the contents of ''​<​replace>​'' ​do not match ''​<​search>​'' ​because this would cause it to be infinitely replaced. ​ | 
-|       ​| ​The result ​of the substitution(s) are assigned back to this    ​variable. | +|   ''​r'' ​  | The ''​<​text>​'' ​argument is the name of a variable. The search and replace is performed on the value of this variable, and the result is assigned back to the variable. |
- +
-======Synopsis:​====== +
-$__msar__(/<​search>/<​replace>/​ ... /<​text>​)+
  
 ======Returns:​====== ======Returns:​======
msar.txt · Last modified: 2014/10/27 09:40 by caf