How do I find a path and file name in a block of text?
Before you mark this as duplicate I know questions about file paths exist
- Regex for parsing directory and filename (does not match in a paragraph.)
- Regex that matches directory path excluding filepath (this one just match the file name, answer doesn't work for paragraphs, and doesn't address
.
orspaces)
- java regular expression to match file path (doesn't address
.
orspaces)
- Regex for extracting filename from path (doesn't address being in a paragraph)
For example
In file included from /some/directoy/3.33A.37.2/something else/dogs.txt,
from /some/directoy/something else/dogs.txt,
from /some/directoyr/3.33A.37.2/something else/dogs.txt,
from /var/log/xyz/10032008.log,
from /var/log/xyz/test.c:29:
Solution:
please the file something.h has to be alone without others include, it has to be present in release letter,
in order to be included in /var/log/xyz/test.c and /var/log/xyz/test.h automatically
Other Note:
The file something.c must contain the somethinge.h and not the ecpfmbsd.h because it doesn't contain C operative code.. everything good..
The following are the ideal matches:
/some/directoy/3.33A.37.2/something else/dogs.txt
/some/directoy/something else/dogs.txt
/some/directoyr/3.33A.37.2/something else/dogs.txt
/var/log/xyz/10032008.log
/var/log/xyz/test.c:29 (this is a tricky one, ok with out it)
/var/log/xyz/test.c
/var/log/xyz/test.h
Going further what if I find an answer how can I change it to work with \
instead of /
directories