I need to create a regular expression that allows a string to optionally contain an asterisk as its first or last character, or both. The string can contain no more than two asterisks and those asterisks must be at the start and/or end of the string.
So these strings would be valid:
foo
*foo
foo*
*foo*
and these strings would not:
*
**
**foo
*f*oo
*f*o*o
*f*o*o*
Thanks in advance.

**, should it match or not?