Given the input line:
<m>1</m>
<m>2</m>
<m>10</m>
<m>11</m>
I would like to replace all values โโthat are not equal 1to 5.
Thus, the output line should look like this:
<m>1</m>
<m>5</m>
<m>5</m>
<m>5</m>
I tried using:
gsub(/(<m>)([^1])(<\/m>)/, '\15\3')
But this does not replace 10and 11.
source
share