View Full Version : The Regex Game...
$cirisme
June 1st 2003, 06:05 PM
And they said that post count boosting is only for the dorm. :teeth:
Here's how it works:
I post a regex.
Everyone guesses what that regex does.
The first one to correctly guess post his regex, and everyone guesses what that regex does.
And so on.
Yeah, this is pretty geeky and will never get to the level of the Word Association thread, but we can try. :teeth:
If it makes a big difference, please note what your regex was designed for.(Ie Perl, PHP, etc)
My Regex:
(\d+)\.(\d+)\.(\d+)\.(\d+)
prgmrdave
June 1st 2003, 06:08 PM
I'd say IP address, but you allowed for arbitrarily many digits (well, an arbitrarily positive number, anyway) between periods...
$cirisme
June 1st 2003, 06:09 PM
That was fast.
You are correct. :teeth:
prgmrdave
June 1st 2003, 06:10 PM
Or it could be a version number on a Windows executable :smile:
yxboom
June 1st 2003, 06:12 PM
WTG pmd! :thumb:
$cirisme
June 1st 2003, 06:13 PM
Post your regex. :teeth:
prgmrdave
June 1st 2003, 06:16 PM
OK, so here's the next one:
([01]\d|2[0-3])(:[0-5]\d){1,2}
$cirisme
June 1st 2003, 06:18 PM
Would match:
152:4848
I have no idea for what. I'll guess Bible verse.
prgmrdave
June 1st 2003, 06:19 PM
Today @ 03:05 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=114547#post114547)
cirisme:
Yeah, this is pretty geeky...
Today @ 03:09 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=114549#post114549)
cirisme:
That was fast.
Of course it was fast, because I have a constant TWeb search running for anything with "geek" in it :yipee:
That, or I just happened to see it at the right time...
prgmrdave
June 1st 2003, 06:20 PM
According to http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx, it doesn't match 152:4848.
prgmrdave
June 1st 2003, 06:21 PM
And I get more spam points if I put my guess and my regex in different posts :teeth:
$cirisme
June 1st 2003, 06:23 PM
I missed a two:
1522:4848
prgmrdave
June 1st 2003, 06:25 PM
The only thing that means is my regex is bad... what do the rules say I do about that?
$cirisme
June 1st 2003, 06:27 PM
I hadn't anticipated that.
What were you trying to match? A zip code?
prgmrdave
June 1st 2003, 06:34 PM
Ain't sayin'. I'll get it right, I will! To wit:
(([01]\d)|(2[0-3]))(:[0-5]\d){1,2}
I think.
prgmrdave
June 1st 2003, 06:35 PM
It just has an extra set of parentheses.
$cirisme
June 1st 2003, 06:36 PM
Matches 1521:4848
Still have no idea what it is. :huh:
$cirisme
June 1st 2003, 06:37 PM
BTW, that regex testing site is pretty cool! :cool:
prgmrdave
June 1st 2003, 06:39 PM
No, it's not, because it gives me inconsistent answers.:rant:
prgmrdave
June 1st 2003, 06:40 PM
No, it doesn't; I just forgot Mr. Hat and Mr. Money.
^(([01]\d)|(2[0-3]))(:[0-5]\d){1,2}$
$cirisme
June 1st 2003, 06:41 PM
Really. Works good for me.
1521:4848 does match(I could tell you that in my sleep), but what is it? :poke:
$cirisme
June 1st 2003, 06:42 PM
Egad man, that is getting strange.
prgmrdave
June 1st 2003, 06:43 PM
Sorry about that... I learned RE's about 20 years ago (and boy, back then we had to walk three miles to the RE evaluator, in the snow, uphill both ways!) and haven't had to use 'em much in the last 12...
prgmrdave
June 1st 2003, 06:45 PM
I figured out why 1521:4848 matched without ^ and $, but I'm Pretty Sure Now that it works correctly. ("Correctly" indicating "the way I mean it to." :smile:)
$cirisme
June 1st 2003, 06:45 PM
<brain freeze>
prgmrdave
June 1st 2003, 06:46 PM
'sokay. I'll give you some more
(ahem)
"time".
$cirisme
June 1st 2003, 06:47 PM
The new one matches 15:38.
I'll guess code column/line number.
Ie, "Error located at 15:38".
If this post made any sense. :xmm:
$cirisme
June 1st 2003, 06:49 PM
'sokay. I'll give you some more
(ahem)
"time".
That was made before I made my above post.
No hinting! I said it was complex, not that I had given up. :poke:
:lol:
$cirisme
June 1st 2003, 06:49 PM
Never mind, I forgot that I said "brainfreeze".
I should go lay down.
prgmrdave
June 1st 2003, 06:52 PM
Yes! 15:38 is in the set of things I intended it to match! Cool!
But not a code column/line number; the expression wouldn't find anything on or after line 24. Need more time?
prgmrdave
June 1st 2003, 06:53 PM
Sorry-- didn't see your "no hinting"
:cir: :whack: me
$cirisme
June 1st 2003, 06:54 PM
Would someone tell please tell Dave that it is a 24 hour matcher...
My brain is too fried to come up with a regex for this game :brow:
dizzle
June 1st 2003, 06:57 PM
Geeks.
$cirisme
June 1st 2003, 06:58 PM
Oh, all right, I couldn't help myself...
.:\\.{1,32}\\.{1,32}\\.{1,32}\..{1,5}
Yea, it's easy. But Dave fried my brain. :teeth:
prgmrdave
June 1st 2003, 06:59 PM
Suggestion:
"prgmrdave, the thread has changed since you began your reply. Would you like to review the new posts before your reply is submitted, in order to prevent the taste of fresh foot?":nc:
$cirisme
June 1st 2003, 07:00 PM
Geeks.
Post count booster.
prgmrdave
June 1st 2003, 07:01 PM
:rofl: (note: not really rolling)
prgmrdave
June 1st 2003, 07:02 PM
Today @ 03:58 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=114601#post114601)
cirisme:
Oh, all right, I couldn't help myself...
.:\\.{1,32}\\.{1,32}\\.{1,32}\..{1,5}
Yea, it's easy. But Dave fried my brain. :teeth:
I'd guess, but then I'd have to post a new one, too, and this time I have to test my code before I publish it :lol:
prgmrdave
June 1st 2003, 07:15 PM
Windows pathname, with drive letter and extension?
$cirisme
June 2nd 2003, 11:33 AM
You're good at this.
prgmrdave
June 2nd 2003, 11:45 AM
I'm a geek. What can I say? :shrug:
^\d+(\.(\d)*)?([Ee][-+]?\d{1,3})?$
$cirisme
June 2nd 2003, 11:49 AM
Would match 5.77E-555. I'm gonna guess an exponential double, or version number. :huh:
prgmrdave
June 2nd 2003, 11:55 AM
Floating-point number w/optional exponent, yep! Got it in one! :cheers:
$cirisme
June 2nd 2003, 12:01 PM
My turn:
([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)
prgmrdave
June 2nd 2003, 12:25 PM
Matches
cirisme rox 1, 2, 3 cirisme rox
Hm.
prgmrdave
June 2nd 2003, 12:27 PM
Matches
testing: 1, 2, 3...
Sound test?
$cirisme
June 2nd 2003, 12:27 PM
:rofl:
Okay, any ideas as to what it does?
$cirisme
June 2nd 2003, 12:27 PM
Sound test?
Nope.
Hint: There is no text.
prgmrdave
June 2nd 2003, 12:31 PM
I know there's no text... it matches because the expression doesn't have ^ and $. Okay, this is my real guess:
3-d spatial coordinates in the positive x-, y-, and z-axes?
$cirisme
June 2nd 2003, 12:33 PM
No.
$cirisme
June 2nd 2003, 12:34 PM
But that's a very good guess.
prgmrdave
June 2nd 2003, 12:51 PM
Matches
4..5, 4.5.6.., ...
:huh:
/me suspects :cir: is going for brain-freeze revenge (and succeeding)
prgmrdave
June 2nd 2003, 01:15 PM
Grr. I see three non-empty groups of digits-plus-decimal-point, separated by comma-plus-non-empty-white-space. Can't figger what the digits represent, though.
3.14, 2.718, 1.414
Error #3.14, line 2.718, column 1.414? :eek:
Jade
June 2nd 2003, 02:12 PM
:eek: I never knew geekiness went to this extreme!:shy:
prgmrdave
June 2nd 2003, 02:13 PM
:rofl:
:yipee:
$cirisme
June 2nd 2003, 02:41 PM
Dave,
Need a hint? :smile:
Jade,
We like to post count boost, too. :poke: :teeth:
prgmrdave
June 2nd 2003, 03:27 PM
cirisme:
Need a hint? :smile:
Stop gloating. :smile:
Matches
., ., .
Yeah, gimme. :help:
$cirisme
June 2nd 2003, 04:04 PM
Think *Nix.
prgmrdave
June 2nd 2003, 04:18 PM
I am going to feel like such a :dunce: when I figure this out (or I cave)...
prgmrdave
June 2nd 2003, 04:24 PM
:idea: user/group/other permissions
:idea: create/mod/access times
:idea: argc, argv, envp
:idea: primary/secondary/tertiary inode tables
:argh:
Grr.
$cirisme
June 2nd 2003, 04:25 PM
:huh:
prgmrdave
June 2nd 2003, 04:27 PM
Just trying to think of *nix things that come in threes...
$cirisme
June 2nd 2003, 04:31 PM
Think down time.
prgmrdave
June 2nd 2003, 04:37 PM
Or "uptime", even.
Load averages?
$cirisme
June 2nd 2003, 04:38 PM
YES!!! You've got it!
:teeth:
prgmrdave
June 2nd 2003, 04:40 PM
:argh:
:dunce:
:duh:
$cirisme
June 2nd 2003, 04:42 PM
Your turn.
(I'm going to pay for that, huh? :help:)
prgmrdave
June 2nd 2003, 04:44 PM
:hamster:
$cirisme
June 2nd 2003, 04:47 PM
:uhoh:
prgmrdave
June 2nd 2003, 05:17 PM
:brow:
^<(\w(-|\w)*:)?\w(-|\w)*(\s+\w(-|\w)*\s*=\s*"[^"]*")*>$
$cirisme
June 2nd 2003, 05:24 PM
:hrm:
No hints, I don't have time to take a crack at this just yet.
:argh: :whack:
prgmrdave
June 2nd 2003, 05:43 PM
Okey doke. :cheers: Take your time.
(No, it's not another time designator :eek:)
$cirisme
June 2nd 2003, 05:48 PM
I'll stick my foot in my mouth:
HTML tag.
I'm probably way off base, as I've barely looked at it, but I do see angle brackets and an = sign in there.
prgmrdave
June 2nd 2003, 05:52 PM
Almost... but not quite. I could be persuaded that you're only one letter off, though. :teeth:
$cirisme
June 2nd 2003, 05:53 PM
XML
prgmrdave
June 2nd 2003, 06:09 PM
:bow: :cir:
Woo hoo!
/me thinks: :uhoh:
$cirisme
June 2nd 2003, 06:10 PM
Or possibly XHTML. :huh:
$cirisme
June 2nd 2003, 06:11 PM
Now, don't even try that silly revenge nonsense ever again. :brow:
.*[\/\\](.*)
prgmrdave
June 2nd 2003, 06:11 PM
Since XHTML is derived from XML, correct on both counts. :cheers:
$cirisme
June 2nd 2003, 06:16 PM
Okie dokie, I wasn't sure how technical you wanted to get. :wink:
What does mine do?
prgmrdave
June 2nd 2003, 06:17 PM
Now, don't even try that silly revenge nonsense ever again. :brow:
:pout:
.*[\/\\](.*)
Are those parentheses literal or grouping? (I've been using un-\\'d parentheses as grouping.)
$cirisme
June 2nd 2003, 06:18 PM
I took that live out of one of my Perl scripts. The parentheses are there to preserve the data that it contains.
prgmrdave
June 2nd 2003, 06:20 PM
Today @ 03:16 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=115314#post115314)
cirisme:
Okie dokie, I wasn't sure how technical you wanted to get. :wink:
Well, the reason it's not HTML is that HTML doesn't require quotes on attribute values, and I didn't know how to represent closing-quote-only-if-there's-an-opening-quote in a regex.
:duh:
I could have used a forward positive match
(?=<stuff>)
Oh, well. Next time. :hamster: Oh, yeah, no revenge. :smile:
prgmrdave
June 2nd 2003, 06:21 PM
No fair. I don't know Perl. :teeth: (Why do I think you're not buying that?)
It captures the last component of a pathname, such as you'd find in a web site log.
$cirisme
June 2nd 2003, 06:23 PM
Yes. I am using it to clean up uploaded files.
Sher
June 2nd 2003, 07:42 PM
:shy:
:hrm:
:eek:
:egad:
:duh:
Sher
June 2nd 2003, 07:42 PM
:bawl:
:idea:
:deal: Pearls?
Sher
June 2nd 2003, 07:43 PM
:lol:
(shameless post/spam points boost)
prgmrdave
June 3rd 2003, 12:41 AM
Yo.
Ya wants ta spam da t'read, ya gots ta play da game.
:whip:
:spam:
:thumb:
Sher
June 3rd 2003, 12:47 AM
:eek:
/me runs for her life
prgmrdave
June 3rd 2003, 01:51 AM
Rats... was hoping someone else wanted to play, too!
Well, then, I guess it's my turn...
(\[((_\w)|([A-Za-z]))\w*])|(((_\w)|([A-Za-z]))\w*)
(This is kind of way out there...)
prgmrdave
June 3rd 2003, 01:59 AM
/me looks around for SherBear...
Sher
June 3rd 2003, 02:52 AM
:shy:
Whispers:
/me is not that geek-y :teeth:
(I don't know programming codes, or I would play)
:angel:
$cirisme
June 3rd 2003, 01:58 PM
I'm too good at this, I get the matches on the first try.
That matches:
_wordwordword
I have no clue for what. :hrm:
$cirisme
June 3rd 2003, 02:00 PM
SherBear,
Give it a try. They have some examples here: http://www.dotnetcoders.com/web/Learning/Regex/definition.aspx
And you can test them at:
http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx
I learned Perl regexes along time ago, and they sure are fun!
prgmrdave
June 3rd 2003, 02:07 PM
It's "way out there" in the sense that I don't know what your languages background is, other than Perl. So instead, how would you phrase my regex in English?
prgmrdave
June 3rd 2003, 02:08 PM
And yes, _wordwordword is in the set of things I intended the RE to match.
$cirisme
June 3rd 2003, 02:16 PM
Maybe a flow of control matcher?
:huh:
prgmrdave
June 3rd 2003, 02:18 PM
It has to do with a programming language, yep. Big surprise :smile:
$cirisme
June 3rd 2003, 02:22 PM
I'll guess basic, but I dunno.
prgmrdave
June 3rd 2003, 02:32 PM
:thumb:
$cirisme
June 3rd 2003, 02:46 PM
Am I right? I've never done basic.
:teeth: :bunny:
prgmrdave
June 3rd 2003, 02:56 PM
Well, I don't know Perl, so we're even again (that wasn't intended to be revenge :hamster:, though).
Yes, you got the language right. :thumb: It matches strings that are valid identifiers in Visual Basic.NET. They can contain letters, digits and the underscore, they can't start with a digit, they can't contain -only- an underscore, and they can be surrounded in square brackets.
Your turn!
$cirisme
June 3rd 2003, 02:58 PM
Okay, give me a little while.
$cirisme
June 4th 2003, 09:46 AM
I'm lazy:
:(\w{2,10}):
prgmrdave
June 4th 2003, 11:37 AM
:Would:
:it:
:match:
:smilies:
? :smile:
$cirisme
June 4th 2003, 01:18 PM
Yes! :smile:
prgmrdave
June 4th 2003, 01:54 PM
Do I get to look through TWeb's source code and pick one now? :smile:
No? :sigh:
Me lazy two.
^\w+(?:\.\w+)*$
$cirisme
June 4th 2003, 01:56 PM
Matches:
Hello:.hello
:hrm:
prgmrdave
June 4th 2003, 02:07 PM
Urgh.
Specifically, it matches the "Hello" part (but not the ":.hello" part).
prgmrdave
June 4th 2003, 02:09 PM
I added anchors to the regex. Shouldn't match "Hello:.hello" any more.
Sher
June 5th 2003, 02:34 AM
:shy: who's winning?
prgmrdave
June 5th 2003, 02:39 AM
:yipee: I am, by default, 'cause :cir: is busy getting ready for a server move :yipee:
prgmrdave
June 5th 2003, 02:41 AM
But as soon as that's off his mind, he's gonna come up with another one like his :argh: load :argh: average :argh: regex. :eek:
prgmrdave
June 5th 2003, 02:41 AM
Only 200 more points 'til I get a pet!
prgmrdave
June 5th 2003, 02:43 AM
Make that 197...
prgmrdave
June 5th 2003, 02:44 AM
Make that... oh, never mind. :teeth:
Sher
June 5th 2003, 07:34 AM
:lol: :thumb:
~Sher, Geek-wannabe
$cirisme
June 5th 2003, 09:49 AM
I should know just by looking at it what it will match... I am losing it.
It matches "H". :hrm:
:argh:
prgmrdave
June 5th 2003, 11:31 AM
:prgmrdave: = :too lazy to test regex's:
In your earlier guess, "Hello:.hello", it didn't match "Hello", it matched "H".
/me starts thinking he can't regex his way out of a paper bag (with signposts)
I edited the regex:
^\w+(?:\.\w+)*$
Maybe this will help?
$cirisme
June 13th 2003, 01:24 PM
Ya got me on this one, everything I think will be a match is not a match... :shrug:
prgmrdave
June 13th 2003, 01:33 PM
My regex is either too complex or too simple. (Or wrong.) :smile:
What should have matched but did not?
$cirisme
June 13th 2003, 01:34 PM
I would have thought hello:.hello:.hello would match, but I am an idiot.
prgmrdave
June 13th 2003, 01:42 PM
Today @ 10:34 AM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=122149#post122149)
cirisme:
I would have thought hello:.hello:.hello would match
It should match without the colons.
but I am an idiot.
Stop that. :whack: You are not.
$cirisme
June 13th 2003, 04:55 PM
Then what is the colon doing in there?
:hrm:
prgmrdave
June 13th 2003, 05:04 PM
(?:<regex>) are grouping (non-capturing) parentheses. Page 136 in O'Reilly's Mastering Regular Expressions book (Jeffrey Friedl), or the summary here (http://www.dotnetcoders.com/web/Learning/Regex/syntax.aspx).
$cirisme
June 13th 2003, 05:15 PM
Oh.
:doh:
jabberwocky
June 17th 2003, 10:56 PM
hostname
hostname.subdomain.etc.tld
except... you can't have "_" in a domain name, can you? And you can have "-".
prgmrdave
June 17th 2003, 10:59 PM
w00t!
You're up to bat. :thumb:
jabberwocky
June 18th 2003, 12:10 AM
(?:/(?:\\.|[^/])*/)|(?:(?:m|s|qr)(\\.|[^{}\(\)<>\[\]])[^$1]*$1)|(?:(?:m|s|qr){(?:\\.|[^{}])})|(?:(?:m|s|qr)\((?:\\.|[\(\)])\))|(?:(?:m|s|qr)<(?:\\.|[^<>])>)|(?:(?:m|s|qr)\[(?:\\.|[^\[\]]\]))
/2 spam points for the regex alone.../
/<evil laugh>/
prgmrdave
June 18th 2003, 12:24 AM
I think it's missing a parenthesis.
prgmrdave
June 18th 2003, 12:24 AM
No, really. :smile:
I think it needs one more at the end.
prgmrdave
June 18th 2003, 12:33 AM
Foo. Never mind, I found it.
prgmrdave :poke: prgmrdave
prgmrdave
June 18th 2003, 01:41 AM
Does it match perl RE's?
jabberwocky
June 18th 2003, 02:37 AM
Today @ 10:41 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=126113#post126113)
prgmrdave:
Does it match perl RE's?
It certainly tries to.
handball back to you :egad:
prgmrdave
June 18th 2003, 09:50 AM
Heh. Not bad, since I don't know perl... okay, lemme think...
$cirisme
June 18th 2003, 08:57 PM
hostname
hostname.subdomain.etc.tld
:doh:
Well, that's just embarassing... :argh:
I'll be in the corner
:shy:
prgmrdave
June 18th 2003, 09:30 PM
You shoulda seen my flat forehead after :argh:'ing jabberwocky's regex!
$cirisme
June 18th 2003, 09:35 PM
It's a long one. :hrm:
jabberwocky
June 18th 2003, 10:49 PM
Today @ 05:57 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=127172#post127172)
cirisme:
Well, that's just embarassing... :argh:
You know, most people give themselves kudos for staying out of this kind of insanely geeky game altogether - look how quickly you got rid of Jade! Left her back on page 4!
I say, good on you for leaving an opening for me to join in!
$cirisme
June 18th 2003, 10:53 PM
Jade was playing? :huh:
jabberwocky
June 18th 2003, 10:59 PM
Jade was here (not playing) only for a second:
06-02-2003 @ 11:12 AM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=115126#post115126)
Jade:
:eek: I never knew geekiness went to this extreme!:shy:
I was thinking of Sher:
06-02-2003 @ 09:47 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=115731#post115731)
Sher:
:eek:
* Sher runs for her life
yxboom
June 18th 2003, 11:04 PM
Yesterday @ 09:10 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=126071#post126071)
jabberwocky:
(?:/(?:\\.|[^/])*/)|(?:(?:m|s|qr)(\\.|[^{}\(\)<>\[\]])[^$1]*$1)|(?:(?:m|s|qr){(?:\\.|[^{}])})|(?:(?:m|s|qr)\((?:\\.|[\(\)])\))|(?:(?:m|s|qr)<(?:\\.|[^<>])>)|(?:(?:m|s|qr)\[(?:\\.|[^\[\]]\]))
/2 spam points for the regex alone.../
/<evil laugh>/
It is a GMT time fix. :whip:
jabberwocky
June 18th 2003, 11:12 PM
:lol: If only it were that simple...
prgmrdave
June 18th 2003, 11:40 PM
Gah. It's harder coming up with good ideas than deciphering others'....
Sher
June 19th 2003, 08:29 AM
Yesterday @ 10:59 PM post located here (http://www.theologyweb.com/forum/showthread.php?s=&postid=127281#post127281)
jabberwocky:
I was thinking of Sher:
:lol: I'm still lurking ... I just don't have a clue :dufus:
(but thanks for thinking of me :teeth:)
prgmrdave
June 20th 2003, 02:32 PM
:hamster:
\[verse=(?:(AMP|ESV|KJV|NASB|NIV|NLT|YLT):)?(?:(1|2|3|I|II|III)\s+)?(\w+)\s+(\d)+(?::(\d)+(?:-(\d)+))\]
:yipee:
jabberwocky
June 21st 2003, 12:17 AM
Any guesses, Sher? What kind of expression is this pattern meant to match?
I'd give you a reference like http://www.perldoc.com/perl5.8.0/pod/perlretut.html which would be sure to give you a clue, but ...
...oh, I gave you it anyway...
jabberwocky
June 25th 2003, 08:02 PM
Sher, your 5 days are about up...
It looks kinda like BB-code/vB-code, what with the whole [something=...] although I haven't seen anything about a [verse] tag. Proposed custom addition for TWeb?
Anyway, it's [verse=X] where X is a series of consecutive verses within a chapter of the Bible, with the version optionally specified.
e.g.
[verse=Armaments 4:16-20]
[verse=KJV:1 John 3:1-16]
Can I assume from your brackets that you meant the verse (especially the second part of a range specification) to be optional: ...)?)?\]
prgmrdave
June 26th 2003, 09:28 AM
Yes, it's a suggestion for the format for an extended [verse] tag, and you are also correct that the range was intended to be optional.
Batter up!
:thumb:
jabberwocky
June 26th 2003, 11:52 AM
/?(?:[\w-.]+/)*[\w-.]+|/?(?:[\w-.]+/)+[\w-.]*|/(?:[\w-.]+/)*[\w-.]*
Xavier
March 22nd 2005, 01:51 AM
:bump:
I remember why I failed my RegEx test... :hehe:
lee_merrill
March 22nd 2005, 04:22 PM
/?(?:[\w-.]+/)*[\w-.]+|/?(?:[\w-.]+/)+[\w-.]*|/(?:[\w-.]+/)*[\w-.]*
Would that be a Unix path to a file, with at least one directory in the path name?
Not sure what [\w-.] matches, tho...
Blessings,
Lee
vBulletin® v3.6.12, Copyright ©2000-2009, Jelsoft Enterprises Ltd.