If you want the directory the shapefile resides in, I would consider using the FilenamePartExtractor. Passing that string will result in a _dirname attribute.
I would skip using a regex for this, simply for the reason that it gets a bit unmaintainable unless you're already familiar with it. The FilenamePartExtractor is my preferred solution.
For fun, you could also simply use an AttributeSplitter followed by a ListIndexer. This has the added bonus of giving direct access to all the individual folder names:
Hi @checcosisani , I agree that FilenamePartExtractor is a better solution in this case, but if you would like to know a regular expression to extract the interest part anyway, try this regex with StringSearcher.