Help in Regex

  • Thread starter Thread starter JM
  • Start date Start date
Thanks for quick reply...
I will do replace for the remaining part of secondary URL to get the
hostname.

Regards
JM
 
(http://).*\1[^/]*/

This does it without any additional work, and a bit more succinctly. It uses
a group and a backreference to grab the string up to the second "http" and
then indicates that any non-'/' character is a match. Finally, it matches
the next '/' character.

No character escapes are necessary, as the slashes are forward-slashes.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
 
Back
Top