Link to home
Start Free TrialLog in
Avatar of brettr
brettr

asked on

Help with regular expression

I have a string similar to this:

\root\sub1\sub2

I need it reformatted to this:

\\++root--\\++sub1--\\++sub2--

Using this only replaces the slash and original text: \\[a-z]*.  Howevr, I don't want to replace the original text.  How can I surround the original text like the above?
SOLUTION
Avatar of Jaax
Jaax
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brettr
brettr

ASKER

Right - the slash will throw an exception.  I ended up using a simple Replace() and then removing unwanted characters from the beginning and appending wanted characters to the end.  It works fine.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brettr

ASKER

Very clean KarinLoos.  Thanks.