I looked up all over but couldn't find an answer for this.
Let's say I have a directory path like this : {MY_PATH}/AAA_unknown_pattern/other/inside/files.../
How can I get path "{MY_PATH}/AAA_unknown_pattern" without knowing "unknown_pattern" and other inside files;
MY_PATH is known and i also know the directory starts with "AAA_"
I tried something like this using regex but it doesn't work:
get_filename_component(TEST "${MY_PATH }/^AAA_" DIRECTORY)
message("test: ${TEST}")
shows "C:/path/until/here/^AAA_" instead of correct path.
The reason of all this is because I want to split after and get unknown_pattern
.
Thank you.
question from:
https://stackoverflow.com/questions/65904787/is-there-a-way-to-find-directory-path-using-regex-on-cmake 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…