473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Need regexp to extract uri from url

Given url's like the following:

http://www.xxx.yyy/foldername/index.cfm?id=165

http://www.xxx.yyy/index.cfm?id=165&pl=1

http://www.xxx.yyy/index.cfm

http://www.xxx.yyy/foldername/subfol...dex.cfm?id=165

I need to get the [/foldername][/subfoldername]/pagename

I've tried a bunch of different things, the best I can get so far is

^http:\/\/.*\/([^\?\#\=]+)[\?\#].*

but that fails when there is no querystring.

Thanks
Scott Emick
Nov 20 '05 #1
1 1406
Cor
Hi Scott,

I am not sure, do you mean you want to know how you do the result of this

Dim myuri As New
Uri("http://www.xxx.yyy/foldername/subfoldername/index.cfm?id=165")
Dim mystring As String = myuri.AbsolutePath

And the other strings, using the regex?

Cor
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mike blamires | last post by:
I am having great difficulty using Unicode characters in a Regular Expression, I am trying to match extended Unicode characters. I am wishing to split a large Dumpfile (containing only JPEGS) I...
13
by: Bob | last post by:
Hello: I could use some regular expression help. I'm trying to create a client-side javascript function that will test user input to determine the markup of text that has been copied into a...
4
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
6
by: papa.coen | last post by:
Hi, I need to split/match the following type of (singleline) syntax on all commas (or text in between) that are not between qoutes: A,'B,B',C,,'E',F The text between quotes can be _any_ text...
2
by: Eric Gibson | last post by:
Hey all, I'm trying to do a regexp that will gracefully extract the fields (fn) from a string in this format: (f1, f2, f3),(f1, f2, f3),(f1, f2, f3),...,(f1, f2, f3) Is there a way I could...
9
by: vbfoobar | last post by:
Hello I am looking for python code that takes as input a list of strings (most similar, but not necessarily, and rather short: say not longer than 50 chars) and that computes and outputs the...
0
by: Ciaran | last post by:
Hi what's the best way to extract a var from a string based on a regexp? I can't seem to find the right function. I want to get the domain extension from any url. examples:...
1
by: Alberto Sartori | last post by:
Hello, I have a html text with custom tags which looks like html comment, such: "text text text <p>text</ptext test test text text text <p>text</ptext test test <!-- @MyTag@ -->extract...
3
by: VUNETdotUS | last post by:
Hi, I am working with this regexp to extract address: city, state, and zip. This version kinda works but it extracts one element of an array instead of three and keeps my "city" too long, including...
19
by: santanu mishra | last post by:
Hi , I am stuck with a requirement from my client to change the date format from mm/dd/yy to dd/mm/yy .If any body can help me out with this regard as its very much urgent. Regards,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.