I apologize I am a novice at regexp and am struggling trying to figure this out. I'm trying to parse a string that is either in one of the two following forms:
1) hostname.company.com:80//directory/...
or
2) hostname.company.com:80//
I am looking to get the hostname and the directory if it exists with a single regexp if possible (for minimalizing code). I currently have the following for the first scenario:
/\:\/\/(.*?)\:\d{2,4}\/\/(.*?)\//
And this works for the second:
/\:\/\/(.*?)\:\d{2,4}\/\//
I was wondering if there was a way construct a single regexp that would work for both? Any suggestions?
Thanks
slaclnx
In reply to Can you do an OR with a REGEXP by slaclnx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |