Skip to content
Advertisement

Laravel: company validation using regex

I don’t have any idea about how to use regex. I want to validate my company field.

For example:

  1. url.co
  2. url.com
  3. url.in

Right now my PHP script takes any string but I want to validate it according to the website URL which contains

string + . + any domain

JavaScript

Advertisement

Answer

try this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement