The address is in blue, the port is in green, and the path is in red. I need to get each of them into some variables (so I can create a tcp socket and connect) but I'm at a loss and cant find any information about doing it in vb.net with regex grouping. Help please :pinch:
Also if you see anything wrong with the regex (not allowing correct urls, allowing fake urls, etc), let me know :)
Question
todd
Here's my regex that checks for valid http URL's (it allows anything for the path because I don't know exactly what is/isnt valid yet):
^(http\://)?((([a-z0-9]){1}(-|\.)?)+\.[a-z]{2,6}|((2[0-4]\d|25[0-5]|[01]?\d?\d)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?))(\:(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d\d\d|[0-5]?\d?\d?\d?\d))?(/.*)?$
The address is in blue, the port is in green, and the path is in red. I need to get each of them into some variables (so I can create a tcp socket and connect) but I'm at a loss and cant find any information about doing it in vb.net with regex grouping. Help please :pinch:
Also if you see anything wrong with the regex (not allowing correct urls, allowing fake urls, etc), let me know :)
Link to comment
Share on other sites
3 answers to this question
Recommended Posts