[TxMt] Replacement pattern for TM_DROPPED_FILE_PATH

marios tmtxpstuff at consking.com
Mon Oct 30 20:43:47 UTC 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

marios wrote:
> I have a case, where I would like to retain the Directory Name of the
> File being dropped.
> 
> In that case, the TM_DROPPED_FILEPATH variable has the following value:
> 
> /Users/username/Sites/siteroot/public_html/textpattern/_templates/articles/article/60.an-example-article.txaml
> 
> I want to retain the last directory name, in this case: article.
> 
> I tried :
> 
> section=`echo $TM_DROPPED_FILE_PATH | perl -pe
> 's/(.*)?(\/)(\w+)(\/)([\d+]+)(\.)(.*)$/$3/g'`
> echo "$section"
> 
> But the variable doesn't echo anything.
> 
> I tested the replacement pattern with find and replace and it gives me
> what I want.
> 
> What am I doing wrong here ?
> 
> Any help appreciated.
> 
> regards, marios

Just realized the silly typo, so void for the above question.
Sorry again.

regards, marios
______________________________________________________________________
For new threads USE THIS: textmate at lists.macromates.com
(threading gets destroyed and the universe will collapse if you don't)
http://lists.macromates.com/mailman/listinfo/textmate

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: This might change in the future
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFRmQD8tSzPOYuZvQRArTJAKCuaZs9S+VczoOgHbWsI8Dn88LRAgCgvT7c
2VozVWSc4/Pu0niPREzFgXE=
=/Nom
-----END PGP SIGNATURE-----



More information about the textmate mailing list