Find speficic string in string

6 Ansichten (letzte 30 Tage)
Benedikt Skurk
Benedikt Skurk am 16 Mär. 2021
Beantwortet: Cris LaPierre am 16 Mär. 2021
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?

Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 16 Mär. 2021
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"

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by