title: Regular expression for remove only starting 3 number if number exist in string
body: <ul>
  <li>Regular expression for remove only starting 3 number if number exist in string or remove character until fix special character if special character exist in the string.</li>
  </ul>
  
  <p>Currently i am using below code but issue this regular expression remove number from full string</p>
  
  <pre><code>public extension String {
      func toPattern() -&gt; String {
          let pattern = "[^A-Za-z]+"
          return self.replacingOccurrences(of: pattern, with: "", options: [.regularExpression])
      }
  }
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>let str1 = "123Apple123"
  print(str1.toPattern()) // 'Apple' But i need Apple123
  
  let str1 = "123App456le"
  print(str1.toPattern()) // 'Apple' But i need App456le
  </code></pre>
  
  <p>Means i want remove number exist of the starting 3(n) character of given string</p>