I do ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/laugh.gif)
Yes there actualy is (the details of this was outlined in the post 2, please reread the therad its usefull for you, but since naughty realy wanted to work on OS paths isntead of maya paths that was also the answer)
Anyway:
CODE
match "^.*|" "|pPlane1|pPlane2|pPlane3";
// Result: |pPlane1|pPlane2| //
This is because the matcher is by default GREEDY! BTW this ones also on brians page!
or if you can use new perllike subst in maya 7 wich i prefeer bacause it can backsubst (im abit misusing backsubst here since the new 3 part subst has s bug in it as it cant subs empty strings)
CODE
substitute "|pPlane1|pPlane2|pPlane3 " "s/[^|]*$/$1/";
// Result: |pPlane1|pPlane2| //
PS if you want all but the rest - the last | this is acualy challenging! Try it its dooable
Think!
Think more!
Cheater
heres one way :
CODE
substitute "|pPlane1|pPlane2|pPlane3 " "s/(.+)[|].+$/$1/";
// Result: |pPlane1|pPlane2 //
And without the possible preceeding |
CODE
substitute "|pPlane1|pPlane2|pPlane3 " "s/[|]*(.+)[|].+$/$1/";
Note in the perllike language | on itself means something totaly else its or. Note both of theese are available on the linked page!