title: Is there a way to replace diferent values in a string?
body: <p>So i'm trying to replace normal numbers for roman numbers, but only the last number is replaced, so i wonder if there's a way to replace diferent values</p>
  <pre><code>sample = &quot;Carl 5, 19 century&quot;
  numbers = re.findall(r'[0-9]+', sample)
  for number in numbers:
      num_int = int(number)
      roman_number = int_to_Roman(num_int)
      new_string = sample.replace(number, roman_number)
  
  &gt;&gt;&gt; Carl 5, XIX century
  </code></pre>
  <p>Here are some other results</p>
  <pre><code>sample = &quot;Carl 19, 19 century&quot;
  &gt;&gt;&gt; Carl XIX, XIX century
  
  sample = &quot;Carl 5&quot;
  &gt;&gt;&gt; Carl V
  </code></pre>