+ Reply to Thread
Results 1 to 3 of 3

How do I grab the 2nd path item from an url? Regex?

  1. #1
    Registered User
    Join Date
    09-26-2014
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    11

    How do I grab the 2nd path item from an url? Regex?

    How can I parse the path of an url and grab the 2nd item in a path. Eg from http://www.bccdc.ca/dis-cond/a-z/_c/...ox/default.htm I need to grab 'a-z'. Can I somehow use a regular expression? Thx!!!

    column A = http://www.bccdc.ca/dis-cond/a-z/_c/...ox/default.htm
    column B = dis-cond (already have this column working)
    column C = a-z (????)

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How do I grab the 2nd path item from an url? Regex?

    With
    A2: http://www.bccdc.ca/dis-cond/a-z/_c/...ox/default.htm

    These regular formulas returns the 1st and 2nd subpaths
    Please Login or Register  to view this content.
    In that example, those formulas return:
    dis-cond
    a-z

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    09-26-2014
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    11

    Re: How do I grab the 2nd path item from an url? Regex?

    Absolutely. I'll give that a shot. MANY THANKS!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. COUNTIF using regex
    By Sathed in forum Excel General
    Replies: 3
    Last Post: 07-07-2014, 02:31 PM
  2. RegEx Problem
    By Marshall80 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-24-2011, 04:49 AM
  3. Excel regex
    By f3tus in forum Excel General
    Replies: 1
    Last Post: 06-05-2010, 06:50 AM
  4. Create formula to grab file path
    By Sonnie in forum Excel General
    Replies: 0
    Last Post: 08-16-2006, 01:50 PM
  5. Return Path of selected item from dialogbox
    By vqthomf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2006, 08:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1