title: Regex to strip trailing 0 but keep the value to a specific length
body: <p>I need to strip values of trailing zeroes but also need to keep the final length of the values to 4.</p>
  
  <pre><code>+--------+
  |codes   |
  +--------+
  |  541100|
  |  54100 |
  |  05810 |
  |  581200|
  |  58140 |
  |  54110 |
  |  48140 |
  |  481400|
  |  723000 |
  |  52000 |
  +--------+
  </code></pre>
  
  <p>the below line is trimming all the trailing zeroes , how do i make sure that it maintains a length of 4.</p>
  
  <pre><code>df.withColumn("strip_codes", regexp_replace(col("codes"), "^([0]+(?!$))|0*$", ""))
  </code></pre>
  
  <p>also, I want to ignore the value <code>05810</code> to match the regex for trailing zeroes 
  o/p DF</p>
  
  <pre><code>+--------+
  |strip_codes   |
  +--------
  |  5411|
  |  5410|
  |  05810|
  |  5812|
  |  5814|
  |  5411|
  |  4814|
  |  4814|
  |  7230|
  |  5200|
  +--------+
  </code></pre>
  
  <p>what changes do i need to make in the existing regex.</p>