Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-06-2010, 10:42 AM
|
#1
|
|
Member
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Rep:
|
Regex
Can someone shed some light what these two regex expresssions solve to:
1) ^/(tv\/[^\/]*\/)$
2) ^/tv\/[^\/]\/(.)
|
|
|
|
08-06-2010, 11:00 AM
|
#2
|
|
Senior Member
Registered: May 2005
Posts: 4,386
|
Quote:
Originally Posted by ganninu
Can someone shed some light what these two regex expresssions solve to:
1) ^/(tv\/[^\/]*\/)$
2) ^/tv\/[^\/]\/(.)
|
How about
man 7 regex
?
|
|
|
|
08-06-2010, 11:02 AM
|
#3
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
|
|
|
|
08-06-2010, 12:19 PM
|
#4
|
|
Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 6,305
|
As you can see from previous answers, if you don't do any work then no one else is inclined to either.
Maybe tell us either which part you do not understand or what you think it equals or what parts equal?
Then we can assist with either incorrect assumptions or educate on plain wrong solutions.
|
|
|
|
08-06-2010, 12:51 PM
|
#5
|
|
Member
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
|
i know i was a bit short and dry in my original post but my apache config is driving me crazy and the regex is the least of my problems atm. anyways, i found the captioned regex expressions and i am trying to make sense out of them to get a complete picture of the infrastructure. These are used within the ProxyPassMatch directive:
1)^/(tv\/[^\/]*\/)$
Match something like this: mydomain.com/tv/anything_but_not_slash/
2) ^/tv\/[^\/]\/(.)
Match something like this: mydomain.com/tv/a
I really hate asking questions i can find answers myself...coming here and being referred to manual pages is really insulting. but anyways, kids.
|
|
|
|
08-06-2010, 01:04 PM
|
#6
|
|
Senior Member
Registered: May 2005
Posts: 4,386
|
Quote:
Originally Posted by ganninu
...coming here and being referred to manual pages is really insulting. ...
|
Really ? As I have established many times already, people simply do not read. I.e. quite often the needed info is the manpage, sometimes even in the first-second line of description, but people still ask questions instead of reading.
I even sometimes request such askers to parse English sentences from the manpages in question in order to show them that the answer is indeed there, but they didn't read it.
My standard question in such cases is: "What is the very first thing you didn't understand ?".
In fact, when I realize I do not understand something in the text I am reading, I ask myself the same question - giving a concrete answer really helps to move forward.
So, what is the very first thing you didn't understand in the manpage ?
Last edited by Sergei Steshenko; 08-07-2010 at 01:22 AM.
|
|
|
|
08-06-2010, 03:10 PM
|
#7
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
http://catb.org/esr/faqs/smart-questions.html#before
http://catb.org/esr/faqs/smart-questions.html#beprecise
http://catb.org/esr/faqs/smart-questions.html#rtfm
String starts with literal "/tv/". Then has 0 or more characters that are not \ or /*. String ends with a literal /. The substring starting with "tv" and ending with / is captured.
String starts with literal "/tv/". Then has one character that is not \ or /. Then has a literal /. Then, one character is captured. After that one character we don't care what's there and don't even try to match it.
* not sure if [^\/] means "not /" or "not \ or /" since it's in a [] block. I should go back to the manual.
It's odd that you're escaping some /s with \s and some of them you aren't. You don't seem to be using // as regex delimiters (regexes are often delineated by /s, ie "$foo =~ /regexhere/;") so it's not clear whether you need to escape them or not.
Last edited by AlucardZero; 08-06-2010 at 03:12 PM.
|
|
|
|
08-07-2010, 12:41 AM
|
#8
|
|
Member
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
|
Yes to me it looks really odd, and since I didn't do the regex, but merely interpreting it in an apache context, I was doubting my regex knowledge and hence came here. In the future I would like to use some tools which help me simulate regex.
Anyways thanks for confirming my thoughts..
|
|
|
|
08-07-2010, 01:14 AM
|
#9
|
|
Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 6,305
|
Quote:
|
Originally Posted by ganninu
I really hate asking questions i can find answers myself...coming here and being referred to manual pages is really insulting. but anyways, kids.
|
Is this meant to be a conundrum?
1. You hate asking questions when you can find the answers yourself .... then why ask??
2. You feel insulted because you are directed to a manual page or reference, so your solution is just to tell everyone answers and not educate .... interesting concept
3. Personally I find it insulting to be called a 'kid' when I am 40+ years of age
If you don't want to be educated or don't like the answers, maybe you should learn how to ask a question!!
The link at the bottom of AlucardZero's signature should be your starting point.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:01 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|