May Sale! All accounts are 40% off this week.

Majeed's avatar

How to write Regex in Laravel

I want write a regex for abc-def-ghi this type of string. a string have must - sign if it'll not available then show a validation message in Laravel

0 likes
2 replies
Tray2's avatar

I recommend using http://regexr.com to test your regular expressions.

Something like

[a-z]{3}-[a-z]{3}-[a-z]{3}

should do the trick

1 like

Please or to participate in this conversation.