fork(1) download
  1. #!/bin/bash
  2. s="... So in the figure 3-12 we see ... similar to figure 3-1..."
  3. echo $s | sed -E 's#(figure +)([0-9-]+)#\1\\ref{fig:\2}#g'
Success #stdin #stdout 0s 19616KB
stdin
Standard input is empty
stdout
... So in the figure \ref{fig:3-12} we see ... similar to figure \ref{fig:3-1}...