0

How to add a regex in laravel validation to check that an input is in this format: 00-00-00 12345678?

cos nik
  • 376
  • 2
  • 14
  • Can you show us what you've tried so far? Some examples of data that should pass validation, and some data that shouldn't? – David Allewell Nov 29 '19 at 12:59
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/a/2759417/3832970) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Nov 29 '19 at 12:59
  • Read the docs: https://laravel.com/docs/master/validation#rule-regex – Paladin Nov 29 '19 at 12:59
  • 10-20-30 12345678 should pass, 100-20-30 12345678 should not pass. I want 2 digits - 2 digits - 2 digits space 8numbers – cos nik Nov 29 '19 at 13:01

0 Answers0