I am working on string maniplations using regex.
Source: string value = @"/webdav/MyPublication/Building%20Blocks/folder0/folder1/content_1.xml";
output required:
Foldername: folder1
content name: content
folderpath:/webdav/MyPublication/Building%20Blocks/folder0/folder1/
I am new to this, can any one say how it can be done using regex.
Thank you.
The rules you need seem to be the following:
Assuming the rules above – you probably want this code:
Note that you can also combine these to become one large regex, although it can be more cumbersome to follow (if it weren’t already):