php - String replacement via Regex -
i've created code writes settings config file (for wordpress eg wp-config), , wraps setting in comments.
such as:
# start wp_memory_limit define('wp_memory_limit', '250m'); # end wp_memory_limit
but inorder optimise code i'm looking drop comments altogether , directly write (and later delete) setting via regex. however, i'm not sure start this. appreciated.
essentially regex able idendify following string of text in config file:
define('wp_memory_limit', 'xxxxxx');
where 'xxxxxx' alphanumerical value.
Comments
Post a Comment