Is it possible to make replaces of multiple regexes at once?

Maaaks via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 23 20:25:52 PDT 2014


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?


More information about the Digitalmars-d-learn mailing list