149 | | A special case is when '''VALUE''' has the form `/regex/[N]/`. In this case the given regular expressen is searched with boost::regex_search in the given filename. If '''N''' is specified it is the number of the subsequent match. For example, if |
150 | | {{{ |
151 | | --const.mycolumn=/_([0-9]+)_/1/ |
152 | | }}} |
153 | | would be matched with ''file_12345_name.ext'', the first sub-sequence (0) would be '_12345_' and the second sub-sequence (1) would be '12345'. Therefore, '12345' would be inserted. Because it is not always apparent which sub-sequence gets which number, a verbosity level of 3 can be used to print the match result. |
| 149 | A special case is when '''VALUE''' has the form `/regex/[format]/`. In this case the filename is replaced given the regular expressen by the format using boost::regex_replace. Replacement uses the standard formatting rules to replace matches (those used by ECMAScript's replace method). If the format is omitted, the default is `$0` which corresponds to just taking the match. For example, if |
| 150 | {{{ |
| 151 | --const.mycolumn=/_([0-9]+)_/$1/ |
| 152 | }}} |
| 153 | would be match the _1234_ in the filename ''file_12345_name.ext''. It would be replaced by the first sub-sequence (%1) which is '12345'. ($0 is the whole match ''_12345_''). |