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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Man ships himself over 2,000 miles in wooden crate while playing online game 7
How to use rss 7
Regex in C# 4
Regex help 1
Regex help needed 1
Need help in RegEx 2
RegEx Help!! 2
Regex help 8

Back
Top