Regex help?



Can someone help me find the last n folders in a path,
or the last n OUs in a fully qualified Netware name... for an app object,
etc?

Example:
\\server\volume\share\folder\folder\folder
I want to grab just the last 2 folders (including or excluding the \s), but
sometimes there
are 3 folders after the share, like in the example, and sometimes there are
more.

Same for an app object in eDirectory
..appobject.dept.biz.site.county.state.tree
How to I grab just the .site.county.state.tree OUs?
Sometimes there are 5 OUs after the app object, and sometimes more.
I want, I think, to start at the end of the string, and grab everything
after the 4th dot from the end, but
don't have a clue how to code this.

I'm not a perl newbie, but I'm no expert.

Thank you,
Chris


.



Relevant Pages

  • Re: Regex help?
    ... > or the last n OUs in a fully qualified Netware name... ... > are 3 folders after the share, like in the example, and sometimes there are ... > Same for an app object in eDirectory ... > I want, I think, to start at the end of the string, and grab everything ...
    (comp.lang.perl)
  • Re: RegEx Help, Please? (match after n)
    ... or the last n OUs in a fully qualified Netware name... ... Same for an app object in eDirectory ... How to I grab just the .site.county.state.tree OUs? ...
    (comp.lang.perl.misc)
  • RegEx Help, Please? (match after n)
    ... Can someone help me find the last n folders in a path, ... Same for an app object in eDirectory ... I want, I think, to "start at the end of the string, and grab everything ... anything mult times, followed by another literal dot, followed, etc... ...
    (comp.lang.perl.misc)