HiJanviDarji,
For checking GST Number the partern should be follow the rule.
- First 2 digits of the GST Number will represent State Code.
- Next 10 digits will be same as in the PAN number of the taxpayer.
- First five will be alphabets (Upper Case)
- Next four will be numbers
- Last will be check code (Upper Case)
- 13th digit will be the number of registration that you take within a state i.e. after 9, A to Z is considered as 10 to 35 .
- 14th digit will be Z by default.
- Last would be the check code.
HTML
<input type="text" id="txtGSTIN" pattern="^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$" title="Invalid GST Number." />
<input type="submit" value="Submit" />
Screenshot

For more details refer below link.
https://stackoverflow.com/questions/44431819/regex-for-gst-identification-number-gstin