Another approach that avoids the regex engine:
$s = 'message-center-db: "http://message-center-db-1b.message-center-d +b.svc.cluster.local"';; substr( $s, 0, index( $s, ':' ) ) =~ tr[-][_];; print $s;; message_center_db: "http://message-center-db-1b.message-center-db.svc. +cluster.local"
In reply to Re: Repeated substitution on 1 side of a line only
by BrowserUk
in thread Repeated substitution on 1 side of a line only
by dspivey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |