ScottInTexas
Board Regular
- Joined
- Oct 28, 2003
- Messages
- 178
I have had a hard time finding a site that explained the construction of a regular expression. But they all seem to copy each other and leave "Capture Group" vague. So this is a possible string from which I want to extract the words. I will type the tabs as (tab) so you know where they are. I want to capture the word groups between tabs. Some groups may contain numbers also.
"The Filename(tab)Some Multiplier 1(tab)Some Amount(tab)name1(tab)name2(tab)or name(tab)another N-1234"
I tried this pattern, \t?(\b\w*\b\s\b\w*\b)\t, and got;
Match 1 = The Filename (this is correct)
Match 2 = Multiplier 1 (it left out the "Some")
Match 3 = Some Amount (this is correct)
Match 4 = name1 name2 (but there is a tab character between the two)
Match 5 = or name (this is correct)
completely blew off the name N-1234
It's close but I don't know how to finish it.
Thanks for your help.
"The Filename(tab)Some Multiplier 1(tab)Some Amount(tab)name1(tab)name2(tab)or name(tab)another N-1234"
I tried this pattern, \t?(\b\w*\b\s\b\w*\b)\t, and got;
Match 1 = The Filename (this is correct)
Match 2 = Multiplier 1 (it left out the "Some")
Match 3 = Some Amount (this is correct)
Match 4 = name1 name2 (but there is a tab character between the two)
Match 5 = or name (this is correct)
completely blew off the name N-1234
It's close but I don't know how to finish it.
Thanks for your help.