HighDots Forums  

Regular Expression to Remove Part of URLs

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Regular Expression to Remove Part of URLs in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mr. Angier
 
Posts: n/a

Default Regular Expression to Remove Part of URLs - 06-19-2008 , 02:09 PM






I need to accomplish the following:

Search for all URLs that contain "http://www.mycompany.com/dept/catalogs/" and
strip off anything past the .../catalogs/"

Basically, I have 3000+ links that begin with
"http://www.mycompany.com/dept/catalogs/" and I need to strip whatever they may
have after the .../catalogs/ piece of the URL.

Anyone know a way to accomplish this?

Thanks in advance!


Reply With Quote
  #2  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-19-2008 , 03:45 PM







In what programming environment are you doing this?

In DW's Find/Replace?

If so, then try this carefully on a test page, as I have not tested it:


Find:

http:\/\/www\.mycompany\.com\/dept\/catalogs\/[^\"]*\"


Replace with:

http://www.mycompany.com/dept/catalogs/"



If you need this in some other environment, let us know.

--


E. Michael Brandt

www.divahtml.com
http://www.divahtml.com/products/scr...extensions.php
Standards-compliant scripts and Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

--

Reply With Quote
  #3  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-19-2008 , 03:45 PM




In what programming environment are you doing this?

In DW's Find/Replace?

If so, then try this carefully on a test page, as I have not tested it:


Find:

http:\/\/www\.mycompany\.com\/dept\/catalogs\/[^\"]*\"


Replace with:

http://www.mycompany.com/dept/catalogs/"



If you need this in some other environment, let us know.

--


E. Michael Brandt

www.divahtml.com
http://www.divahtml.com/products/scr...extensions.php
Standards-compliant scripts and Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

--

Reply With Quote
  #4  
Old   
Mr. Angier
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-20-2008 , 09:53 AM



That worked! Thank you.

Reply With Quote
  #5  
Old   
Mr. Angier
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-20-2008 , 09:53 AM



That worked! Thank you.

Reply With Quote
  #6  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-20-2008 , 10:37 AM



Mr. Angier wrote:
Quote:
That worked! Thank you.
You are very welcome.


--


E. Michael Brandt

www.divahtml.com
http://www.divahtml.com/products/scr...extensions.php
Standards-compliant scripts and Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

--


Reply With Quote
  #7  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Regular Expression to Remove Part of URLs - 06-20-2008 , 10:37 AM



Mr. Angier wrote:
Quote:
That worked! Thank you.
You are very welcome.


--


E. Michael Brandt

www.divahtml.com
http://www.divahtml.com/products/scr...extensions.php
Standards-compliant scripts and Dreamweaver Extensions

www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia

--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.