fork download
  1. import re
  2. word = "string_str word"
  3. print(re.sub(r"[ ](?=[ ])",' |', word))
Success #stdin #stdout 0.02s 9488KB
stdin
Standard input is empty
stdout
string_str | | | | word