Ich versuche, einen regulären Ausdruck zu erstellen, um Informationen in einer Textdatei (Notepad ++) zu durchsuchen, aber nur, wenn das Zeichen ein "das" im Namen hat.Wie werden alle Textgruppen, die ein bestimmtes Wort in einer bestimmten Zeile enthalten, abgeglichen?
Mein aktueller Ausdruck: \\{[\r\n]+id:(.\*?)+name:\s+(\bthe\b)(.*?)[\r\n]\\}
{
id: 1
locID: A
tStart: 17:10:00
tEnd: 17:35:00
name: the man 45
text: Lorum Ipsum
}
{
id: 2
locID: A
tStart: 17:11:00
tEnd: 17:12:00
name: Frank
text: Lorum Ipsum
}
{
id: 3
locID: A
tStart: 17:11:00
tEnd: 17:14:00
name: Frank
text: Lorum Ipsum
}
{
id: 4
locID: B
tStart: 17:51:00
tEnd: 17:56:00
name: the woman 2
text: Lorum Ipsum
}
{
id: 5
locID: A
tStart: 17:11:00
tEnd: 16:11:00
name: the man with the golden gun
text: Lorum Ipsum
}
{
id: 6
locID: C
tStart: 17:11:00
tEnd: 17:11:00
name: the woman with the dragon tattoo
text: Lorum Ipsum
}
{
id: 7
locID: A
tStart: 17:15:00
tEnd: 17:15:00
name: Jo
text: Lorum Ipsum
}
Was ich will, ist nur zu bekommen
{
id: 1
locID: A
tStart: 17:10:00
tEnd: 17:35:00
name: the man 45
text: Lorum Ipsum
}
{
id: 4
locID: B
tStart: 17:51:00
tEnd: 17:56:00
name: the woman 2
text: Lorum Ipsum
}
{
id: 5
locID: A
tStart: 17:11:00
tEnd: 16:11:00
name: the man with the golden gun
text: Lorum Ipsum
}
{
id: 6
locID: C
tStart: 17:11:00
tEnd: 17:11:00
name: the woman with the dragon tattoo
text: Lorum Ipsum
}
Kann mir jemand sagen, was ich brauche den Rest der Zeile überspringen zu tun?
Meine aktuelle Setup alles zurückgibt, und Frank id:2
Frank id:3
the woman 2 id:4
.
Dank mickmackusa.
Lösung: {[^}] * Name: [^}] * \ bthe \ b [^}] * \}
anzeigen Quelle, aus dem Sie Daten analysieren. – tilz0R