This is a verified interview question from Wells-fargo. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Validating Strings with Same Start and End Character" covers key patterns like Strings.
"Construct a regular expression that checks if a token both begins and ends with the same symbol. A token is considered valid when its first and last character are identical. From a collection of inputs comprised solely of the characters 'c' and 'd', design a regular expression to match only those inputs that share their first and last character. ### Problem Fill in the blank ("______") with a regular expression that meets these criteria. The locked code in the editor outputs True for matching inputs and False otherwise.  ### Input - 1 ≤ query ≤ 10^3 - 1 ≤ length of each string[i] ≤ 10^3 - Each character string[i] is either 'c' or 'd' ### Output The regular expression to validate strings."
Join thousands of developers practicing for Wells-fargo.