{"id":14734909,"date":"2021-08-04T16:22:46","date_gmt":"2021-08-04T16:22:46","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/regular-expression-indian-pan-aadhar-card\/"},"modified":"2021-08-04T16:22:46","modified_gmt":"2021-08-04T16:22:46","slug":"regular-expression-indian-pan-aadhar-card","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/regular-expression-indian-pan-aadhar-card\/","title":{"rendered":"Regular Expression &#8211; Indian PAN &amp; Aadhar Card"},"content":{"rendered":"<p>Dear Friends,<\/p>\n<p>I am using RegExp at my ppix.tv site on Form 10.  I managed to add two of my own custom expressions viz. the Indian PAN No. &amp; the Indian Aadhar No.  The entered data gets accommodated fine with what I have created.  However, I wish it to be a bit smart by way of getting automatically formatted.  And therein I need help.<\/p>\n<p>The PAN No. is a 10 digit alphanumeric.  For example let us take mine.  It is AAKPK4764H.  My expression allows it to be stored either with spaces like AAKPK 4764 H or with hyphens like AAKPK-4764-H.  But whereas if the user is to not put in either the space or the hyphen and just enter the 10 digits then I want the plugin to by default add the hyphen in a 5-4-1 manner in the end result.  I also want the user&#8217;s lower case entry converted to an upper case entry e.g. aakpk 4764 h should automatically get converted to AAKPK-4764-H.  Can you kindly help me achieve this?<\/p>\n<p>Also, the same way for the Aadhar No.  I wish that the plugin by default make it 4-4-4 by automatically adding the hyphens after every 4 digits if the user has not added them manually.  Can someone kindly help me achieve this?<\/p>\n<p>My PAN Regular Expression is :<br \/>\n\/(^[A-Z]{5}[0-9]{4}[A-Z]{1}$)|(^[A-Z]{5}\\s[0-9]{4}\\s[A-Z]{1}$)|(^[A-Z]{5}-[0-9]{4}-[A-Z]{1}$)\/<\/p>\n<p>and whereas my Aadhar Regular Expression is :<br \/>\n\/(^[0-9]{4}[0-9]{4}[0-9]{4}$)|(^[0-9]{4}\\s[0-9]{4}\\s[0-9]{4}$)|(^[0-9]{4}-[0-9]{4}-[0-9]{4}$)\/<\/p>\n<p>Can these be suitably modified to help me achieve what I am looking for?  Can someone kind here help me please?<\/p>\n","protected":false},"template":"","class_list":["post-14734909","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14734909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14734909\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14734909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}