Hi
can you help me to find the correct regex to extract only the string in bold (ALESSANO)
\\\\199.168.30.208\\dati\\pippo\\PUGLIA\\ALESSANO\\INGRESSO\\ALESSANO\\tracciato unico.shp
thx
Francesco
Hi
can you help me to find the correct regex to extract only the string in bold (ALESSANO)
\\\\199.168.30.208\\dati\\pippo\\PUGLIA\\ALESSANO\\INGRESSO\\ALESSANO\\tracciato unico.shp
thx
Francesco
You can use stackoverflow for this. Also do you just want ALESSANO or du you always want the value between the second to last \\ and the last \\.
Also can't you just use the FilenamePartExtractor transformer for this kind of stuff.
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.
(?<=\\)n^\\]+(?=\\<^\\]+$)