|
-
Mar 10th, 2004, 11:07 AM
#1
Thread Starter
Frenzied Member
Regular Expressions
I'm having trouble working out a regular expression to do the following.
I have a string that can contain text in the following formats:
/
/imex
/imex/design
/imex/design/layouts
/other
/other/test
/other/test/something
/other/test/something/etc
(There is no limit to the number of subdirectories.)
I need to get the text between the second and third forward slashes OR the text between the second forward slash and the end of the string if a there isn't a third forward slash OR if there isn't a second forward slash return String.Empty.
So the example above would give:
String.Empty
String.Empty
design
design
String.Empty
test
test
test
Note the regular expression should be case insensitive.
Any help would be appreciated - I'm new to C# so take it slow!
DJ
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|