Hello,
K+N provided information for a Format check rule for the Singapore GST Number(Sources and Format). Please see the information below:
Singapore GST Format
There isn't a single, definitive webpage outlining the exact GST number format. However, the information I provided is consistent with various reliable sources:
Singapore's Tax Authority (IRAS): While IRAS doesn't explicitly state the format on a single webpage, their website allows searching for GST registered businesses using the 10-character alphanumeric format. This implies that's the accepted format. You can find the search tool here: IRAS GST Registered Business Search: https://mytax.iras.gov.sg/ESVWeb/default.aspx?target=GSTListingSearch
OECD (Organisation for Economic Co-operation and Development): Their report on Singapore's tax identification numbers mentions the Unique Entity Number (UEN) format, which can be linked to the GST number for businesses. The format of UEN (10 characters, alphanumeric) aligns with the GST number format we discussed. Find the report here: https://www.uen.gov.sg/
Freelance platforms: Platforms like Upwork, which deal with international transactions, often provide information on GST requirements for different countries. Their resources on Singapore GST mention the 10-character alphanumeric format. For example, Upwork's information on Singapore GST: https://support.upwork.com/hc/en-us/articles/18522237022483-Singapore-GST-for-freelancers
While there might not be a single official page outlining the exact format, the consistency across these reliable sources strongly suggests the 10-character alphanumeric format for Singapore GST numbers.
Singapore GST number format regex:
Code snippet
^[A-Z\d]{2}-[A-Z\d]{6}-[A-Z]$
This regex breaks down as follows:
^: Matches the beginning of the string.
[A-Z\d]{2}: Matches exactly two characters, either uppercase letters (A-Z) or digits (0-9). This captures the first part of the GST number.
-: Matches a literal hyphen (-) separating the sections.
[A-Z\d]{6}: Matches exactly six characters, again allowing either uppercase letters or digits. This captures the middle section of the GST number.
-: Matches another literal hyphen (-) separating the sections.
[A-Z]: Matches a single uppercase letter (A-Z) for the final character of the GST number.
$: Matches the end of the string.
This regex ensures the GST number follows the correct pattern of two alphanumeric characters, a hyphen, six more alphanumeric characters, another hyphen, and a final uppercase letter.
Identifier type was added to CDQ metadata and a corresponding rule is now available, see https://meta.cdq.com/Identifier_format_invalid_(GST_number_(Singapore))
Hey Simon,
K+N provided me additional information:
Reason for Updated REGEX
There are actually two main components to the format variations for GST Numbers in Singapore:
Prefix: While not mandatory, Singapore GST Numbers may have a prefix depending on the registration date and type of entity. Here are the common prefixes:
M9: This prefix was commonly used for businesses registered before April 2017.
S: This prefix is used for some businesses registered after April 2017.
No Prefix: Some businesses, especially those registered electronically, may not have a prefix at all.
T, U, or L: These prefixes are less common and might be used for specific entity types like trusts (T), representative offices (U), or limited liability partnerships (LLP) (L).
Core Structure: This refers to the remaining elements that make up a valid GST number:
Seven or Eight Digits: Following the optional prefix (if any), there will be either seven or eight digits. The number of digits depends on the specific prefix used.
Hyphens: There will be two hyphens separating the prefix (if present) from the digits and the check digit.
Check Digit: The last character is a single uppercase letter that acts as a validation check for the entire number.
Here's a summary of the different format possibilities:
M9-XXXXXXX-X (Most Common): Prefix "M9" followed by seven digits, two hyphens, and a check digit (uppercase letter).
S-XXXXXXX-X: Prefix "S" followed by seven digits, two hyphens, and a check digit.
XXXXXXX-X: No prefix, followed by eight digits, two hyphens, and a check digit. (Less common)
T/U/L-XXXXXXXX-X: Less frequent prefixes (Trust/Representative Office/LLP) followed by eight digits, two hyphens, and a check digit.
Singapore GST number format updated regex:
Based on the above info. Could you update this in the idea portal?
^(?:[SMTU]?|\d{2})-?(\d{7}|\d{8})-[A-Z]$
Explanation of the Improved REGEX:
^(?:[SMTU]?|\d{2}): Matches the beginning of the string and allows for an optional prefix (either "S", "M9", "T", "U", a single digit, or two digits). The "?" after the prefix options makes them non-capturing groups, improving readability.
-?: Matches an optional hyphen (since a hyphen might not always follow the prefix).
(\d{7}|\d{8}): Capturing group that matches either seven or eight digits, depending on the prefix used.
-: Matches a hyphen.
[A-Z]: Matches a single uppercase letter (the check digit).
$: Matches the end of the string.
Does this help?
We'd lovve to add support for GST validation, however please support us with a bit more information.
In the simplest way, without knowing better, we would provide an initial rule that just allows for 9 or 10 alphanumeric digits, not considering hyphens or whitespaces.
UEN
According to our knowledge the UEN can consist of 9 or 10 alphanumeric digits. See: https://www.uen.gov.sg/ueninternet/faces/pages/admin/aboutUEN.jspx
Your regular expression
The regular expression that you provided via chatGPT does not reflect what you wrote in the text.
It would just allow for 9! alphanumeric digits like: AA-AAAAAA-A or when considering the hyphens 11 chars.
We are wondering about the hyphens as they are not mentioned for UEN numbers somewhere, respectively the official GST search also just provides examples without hyphens
Example
Could you provide us with some existing example, i.e. a company name with UEN and corresponding GST that could be found with above website.