fork(1) download
  1. import re
  2. z="CONN <DO_NOT_PRINT>user</DO_NOT_PRINT>/<DO_NOT_PRINT>password</DO_NOT_PRINT>@//host:port/service"
  3. REPLACEME = re.compile('<DO_NOT_PRINT>(.*?)</DO_NOT_PRINT>', re.DOTALL)
  4. print( REPLACEME.sub(lambda x: '*' * len(x.group(1)), z) )
  5.  
Success #stdin #stdout 0.03s 9448KB
stdin
Standard input is empty
stdout
CONN ****/********@//host:port/service