title: Add leading zero within a character string
body: <p>One column of my data.frame looks like the following:</p>
  
  <pre><code>c("BP_1_CSPP", "BP_2_GEGS", "BP_3_AEAG", "BP_4_KPAP", "BP_5_TAKP", 
  "BP_6_GGDR", "BP_7_MQQP", "BP_8_EEEE", "BP_9_RSDP", "BP_10_APAS", 
  "BP_11_KRGG", "BP_12_RSQQ", "BP_13_QQLS", "BP_14_EPEV", "BP_15_AAPS", 
  "BP_16_SDVT", "BP_17_GQQQ", "BP_18_AETP", "BP_19_PPSA", "BP_20_DATP", 
  "EpQ_1_AYAT", "EpQ_2_HEKL", "EpQ_3_SCSV", "EpQ_4_MAYV", "EpQ_5_LKDP", 
  "EpQ_6_ERCE", "EpQ_7_DNPA", "EpQ_8_YGIS", "EpQ_9_GMSS", "EpQ_10_AAKK", 
  "EpQ_11_NIRI", "EpQ_12_ERRR", "EpQ_13_MDRE", "EpQ_14_SRQM", "EpQ_15_DWSI", 
  "EpQ_16_VLVQ", "EpQ_17_GRTI", "EpQ_18_EKVR", "EpQ_19_PDVA", "EpQ_20_ADVT", 
  "LbT_1_RPGG", "LbT_2_TQGD", "LbT_3_EVKS", "LbT_4_VIEM", "LbT_5_GSAD", 
  "LbT_6_VRPI", "LbT_7_CELG", "LbT_8_APQQ", "LbT_9_SAEE", "LbT_10_GEAE", 
  "LbT_11_EELR", "LbT_12_EWAN", "LbT_13_IKEE", "LbT_14_VSDF", "LbT_15_WEDV", 
  "LbT_16_SGGA", "LbT_17_KATN", "LbT_18_EREG", "LbT_19_AWAS", "LbT_20_VDRD", 
  "abc_1_CVTQ", "abc_2_KEAP", "abc_3_TAYI", "abc_4_MITN", "abc_5_MPTV", 
  "abc_6_TRTG", "abc_7_KSTI", "abc_8_KEAI", "abc_9_HVYS", "abc_10_LGMG", 
  "abc_11_VAYQ", "abc_12_AGTG", "abc_13_TDSW", "abc_14_HKKS", "abc_15_YGLA", 
  "abc_16_WEEW", "abc_17_HSTI", "abc_18_EKCI", "abc_19_PAGI", "abc_20_TGTI", 
  "TcII")
  </code></pre>
  
  <p>Considering all the numbers &lt; 10, which are located within the strings (e.g. "BP_<strong>1</strong>_CSPP", "BP<strong>_2</strong>_GEGS" , I wanted to add a leading zero to them, such that I would have:</p>
  
  <pre><code>"BP_01_CSPP", "BP_02_GEGS", "BP_03_AEAG", "BP_04_KPAP", "BP_05_TAKP", 
  "BP_06_GGDR"
  </code></pre>
  
  <p>and so on. </p>
  
  <p><a href="https://stackoverflow.com/questions/8266915/format-number-as-fixed-width-with-leading-zeros">This question</a> almost did the job, yet it does not worked for my data as:</p>
  
  <ol>
  <li><p>The "0" will not be inserted at the same position all the time (some strings have 3 characters before the 0 to be inserted (e.g. <strong>BP_</strong>1_CSPP) while others have 4 (e.g. <strong>EpQ_</strong>3_SCSV) </p></li>
  <li><p>I will still have some characters after the zero to be inserted i.e. the zero will be inserted at the middle of the string.</p></li>
  </ol>