Regular Expressions to Validate Google Analytics Tracking Id
Improve Article
Save Article
Like Article
Improve Article
Save Article
Given some Google Analytics Tracking IDs, the task is to check if they are valid or not using regular expressions. Rules for the valid Tracking Id are:It is an alphanumeric string i.e., containing digits (0-9), alphabets (A-Z), and a Special character hyphen(-).The hyphen will come in between the given Google Analytics Tracking Id.Google Analytics Tracking Id should not start and end with a hyphen (-).It should not contains whitespaces and other…