Last Updated: February 25, 2016
·
479
· amrnt

Validate full_name

A regular expression to validate a full_name

validates :full_name,
    presence: true,
    length: { maximum: 50, minimum: 5 },
    format: {
        with: /^[\p{L}\p{Nl}[^0-9`!@#\$%\^&*+_=]]{2,}[\s]{1,}[\p{L}\p{Nl}[^0-9`!@#\$%\^&*+_=]]{2,}$/u,
        message: 'write your real name.'
    }

I tested this against many cases. If it fails somehow let me know.