finding patterns using regex
Restructuring the pwd