Hi all, I am trying to find a regular expression that does the following:-

Sample Strings:

1. "/somefolder"
2. "/specific_folder/aaaa"
3. "/myfolder/bbbb"

I would like to match everything after the first "/" for all strings except
#2. i.e. for all cases except when it starts with "specific_folder". Any
ideas? Right now what I have for my regular expression is "/(.*)". But that
captures everything.

TIA!

Re: regular expression help by Steve

Steve
Thu Jun 17 13:28:36 CDT 2004

RP wrote:

> Hi all, I am trying to find a regular expression that does the
> following:-
>
> Sample Strings:
>
> 1. "/somefolder"
> 2. "/specific_folder/aaaa"
> 3. "/myfolder/bbbb"
>
> I would like to match everything after the first "/" for all
> strings except #2. i.e. for all cases except when it starts with
> "specific_folder". Any ideas? Right now what I have for my regular
> expression is "/(.*)". But that captures everything.

.Pattern = "^/(?!specific_folder/)(.*)"

--
Steve

Everyone thinks of changing the world, but no one thinks of changing
himself. -Leo Tolstoy

Re: regular expression help by RP

RP
Thu Jun 17 14:17:29 CDT 2004

Thanks a bunch! That did it.

"Steve Fulton" <cerberus40@hotmail.com> wrote in message
news:opr9q39yz4boz00o@msnews.microsoft.com...
> RP wrote:
>
> > Hi all, I am trying to find a regular expression that does the
> > following:-
> >
> > Sample Strings:
> >
> > 1. "/somefolder"
> > 2. "/specific_folder/aaaa"
> > 3. "/myfolder/bbbb"
> >
> > I would like to match everything after the first "/" for all
> > strings except #2. i.e. for all cases except when it starts with
> > "specific_folder". Any ideas? Right now what I have for my regular
> > expression is "/(.*)". But that captures everything.
>
> .Pattern = "^/(?!specific_folder/)(.*)"
>
> --
> Steve
>
> Everyone thinks of changing the world, but no one thinks of changing
> himself. -Leo Tolstoy