Hi,
I am trying to "filter" a string of the following form:
//some text before
Drives
*********
cdr LITEON DVD-ROM LTD163 GDHA
cdr HL-DT-ST CD-RW GCE-8400B B104
Msg
*********
//some more text here
From this string I am trying to get the following 2 strings:
1. "LITEON DVD-ROM LTD163 GDHA"
2. "HL-DT-ST CD-RW GCE-8400B B104"
I tried to use the following regexp:
p = Pattern.compile("cdr\\s*([\\w\\p{Punct}]*)\\s*([\\w\\p{Punct}]*)\\s*([\\w\\p{Punct}]*)\\s*([\\w\\p{Punct}]*)\\s*(?:Msg)");
m = p.matcher(str_input);
However, if I try this, it only returns the first string and not the second.
(I am new to regexps and still trying to read up on this topic).
Any advice or help on what I am doing wrong here would be appreciated.
thanks.