April 24, 2014 Is it possible to make replaces of multiple regexes at once? | ||||
---|---|---|---|---|
| ||||
Hi. I'm looking for a function that can perform multiple replaces at once. For example, there's such function in PHP, here's example from its site: <?php $patterns = array ('/(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/', '/^\s*{(\w+)}\s*=/'); $replace = array ('\3/\4/\1\2', '$\1 ='); echo preg_replace($patterns, $replace, '{startDate} = 1999-5-27'); ?> Does D have similar function? |
Copyright © 1999-2021 by the D Language Foundation