Find speficic string in string

6 ビュー (過去 30 日間)
Benedikt Skurk
Benedikt Skurk 2021 年 3 月 16 日
回答済み: Cris LaPierre 2021 年 3 月 16 日
Hi hopefully u can help me!
I want to find a speficic pattern in the following string:
\skurk.IntUser\ABCD_DeutS_1v1.IntPrj\Netzmodell.IntPrjfolder\Netzdaten.IntPrjfolder\320_HERTZA.ElmNet\HERTZA NETZ\Österreich\D8D81 GRD00.ElmSite\Trafo101.ElmTr3
This is the string/part i want to get:
320_HERTZA.ElmNet\HERTZA NETZ\Österreich\D8D81 GRD00.ElmSite\Trafo101.ElmTr3
I tried it with
a = regexp(Variables,'Netzdaten.IntPrjfolder\\[a-zA-Z0-9_.\\ ÄÖÜ+');
but i only get any numbers back. Can someone help me?

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 3 月 16 日
If you don't understand regexpr, like many of us, look at the new Match Pattern functions on this page. They start about halfway down.
I would look at the extractafter function for your task.
folder = "\skurk.IntUser\ABCD_DeutS_1v1.IntPrj\Netzmodell.IntPrjfolder\Netzdaten.IntPrjfolder\320_HERTZA.ElmNet\HERTZA NETZ\Österreich\D8D81 GRD00.ElmSite\Trafo101.ElmTr3";
str = extractAfter(folder,"Netzdaten.IntPrjfolder\")
str = "320_HERTZA.ElmNet\HERTZA NETZ\Österreich\D8D81 GRD00.ElmSite\Trafo101.ElmTr3"

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by