?
-
i have a sample text:
"Key: Value Key: Value2 Key: Value3 Subkey: apple Subkey: orange Key:
Value 4"
i need to extract:
"Subkey: apple Subkey: orange"
i have a regex expression:
p.compile("Key: Value2\\s.*(Subkey:\\s.*)Key:");
which only succeeds in extracting "Subkey: orange"
i am pretty sure the solution is to repeat the portion using
(Subkey:\\s.*)* <--- extra asterisk.
BUT in java, the bracket means something else and i don't know how to
make it work.
any help is appreciated. thank you.
"Key: Value Key: Value2 Key: Value3 Subkey: apple Subkey: orange Key:
Value 4"
i need to extract:
"Subkey: apple Subkey: orange"
i have a regex expression:
p.compile("Key: Value2\\s.*(Subkey:\\s.*)Key:");
which only succeeds in extracting "Subkey: orange"
i am pretty sure the solution is to repeat the portion using
(Subkey:\\s.*)* <--- extra asterisk.
BUT in java, the bracket means something else and i don't know how to
make it work.
any help is appreciated. thank you.