Test, validate and match regular expressions
Validates a nickname field by matching strings of 0–25 characters consisting only of letters, hyphens, apostrophes, forward slashes, commas, or spaces, or alternatively a single underscore. Anchored with ^ and $ and used with global/multiline flags so each line of input is validated independently. Typically used in .NET form validation to restrict user-entered nicknames to a safe character whitelist with a 25-character limit.