-4

I am not sure what this Regex means.

pattern="^[\w\s-\'\.]${1,0}"

Can someone provide suggestions?

chris85
  • 23,255
  • 7
  • 28
  • 45
mint_x
  • 9
  • 3

1 Answers1

0

The given Regular Expression is probably wrong.
It's right till here : ^[\w\s-\'\.]$
The line actually ends at $.
Why would you need that {0,1} ?

Anyway, here's the explanation for the right part :
^ asserts position at start of the string
[\w\s-\'\.] Match a single character present in the list below
\w matches any word character (equal to [a-zA-Z0-9_])
\s matches any white-space character (equal to [\r\n\t\f\v ])
- matches the character - literally (case sensitive)
\' matches the character ' literally (case sensitive)
\. matches the character . literally (case sensitive)
$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)