![]() Topic awaiting preservation: [reqex] In search of... (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Berlin, Germany |
![]() ...a regular expression to validate a uri. |
Bipolar (III) Inmate From: Berlin, Germany |
![]() The first part: code: [a-zA-Z][a-zA-Z0-9\+-\.]* # scheme :\/\/ ((([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]\.)* # domainlabel [a-zA-Z][a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9] # toplabel \.?)| # additional period ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)) # IPv4 address (:[0-9]+)? # port
|
Bipolar (III) Inmate From: Berlin, Germany |
![]() Ok, here is the full code: code: [a-zA-Z][a-zA-Z0-9\+-\.]* # scheme :\/\/ # ((([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]\.)* # domainlabel [a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9] # toplabel \.?)| # additional period ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)) # IPv4 address (:[0-9]+)? # port / # ([a-zA-Z0-9-_\.!~*'\(\)] # unreserved |%[0-9a-fA-F]{2} # escaped |[:@&=\+\$;])* # (/([a-zA-Z0-9-_\.!~*'\(\)] # unreserved |%[0-9a-fA-F]{2} # escaped |[:@&=\+\$;])*)* # (\? # query: ([;\/\?:@&=\+\$,] # reserved |[a-zA-Z0-9-_\.!~*'\(\)] # unreserved |%[0-9a-fA-F]{2})*)* # escaped
|
Bipolar (III) Inmate From: Berlin, Germany |
![]() Fixed some bugs, cleaned and added userinfo: code: [a-zA-Z][a-zA-Z\d\+\-\.]*:\/\/ # scheme + :// (([\w\-\.!~'\*\(\);:&=\+\$,]|%[\da-fA-F]{2})+@)?# userinfo ((([a-zA-Z\d][a-zA-Z\d\-]*[a-zA-Z\d]\.)* # domainlabel [a-zA-Z][a-zA-Z\d\-]*[a-zA-Z\d]\.?) # toplabel |([\d]+\.[\d]+\.[\d]+\.[\d]+)) # IPv4 address (:[\d]+)? # port / # path: ([\w\-\.!~\*'\(\):@&=\+\$;] # unreserved |%[\da-fA-F]{2})* # escaped (/([\w\-\.!~\*'\(\):@&=\+\$;] # unreserved |%[\da-fA-F]{2})*)* # escaped (\? # query: ([;\/\?:@&=\+\$,] # reserved |[\w\-\.!~\*'\(\)] # unreserved |%[\da-fA-F]{2})*)* # escaped
|
Maniac (V) Inmate From: Sthlm, Sweden |
![]() Someone once said: "Hey, I can solve this problem with regular expressions!" This man now has two problems... |