Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's a prefix regular expression?

Tags:

regex

I'm reading something that mentions prefix regular expressions, and sites as an example /^joey/

What's a prefix regular expression? Does that mean it starts with a caret?

like image 831
Dave Avatar asked Oct 24 '11 16:10

Dave


1 Answers

in REGEX ^ at the start of a regex means, "Starts with"

/^joey/

Would therefore match any string that starts with "joey" such as "joeyjoey" or "joey and jane"

like image 125
zellio Avatar answered Oct 23 '22 23:10

zellio