Other contributors have said "What's an example of a regular expression?" is the same question as "What is an example of a regular expression?" If you believe that these are not asking the same thing and should be answered differently, click here

What is an example of a regular expression?

Answer:
A Perl regular expression that is meant to check if a string has only letters, underscores, hyphens, and numbers would look something like this:

/^[A-Za-z0-9_-]+/$

However, regular expressions from different language are formed differently - this example is just one of the many forms of regular expressions.

First answer by Twiyp. Last edit by Twiyp. Contributor trust: 190 [recommend contributor recommended]. Question popularity: 2 [recommend question].