Skip to content

Regex for IP Range #29

@perfecto25

Description

@perfecto25

dont have time to submit pull req, but this regex checks for IP validity, can provide 1 IP addr or a range, ie

192.168.5.100-192.200.20.255

^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^.*-,{3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$

you can check it here
https://regex101.com/

Also for email, this regex is more encompassing
^[a-zA-Z0-9_.+-]@[a-zA-Z0-9_.+-].[a-z][a-z][a-z]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions