pegguy
unread,Mar 8, 2013, 11:25:49 AM3/8/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pe...@googlegroups.com
Hello again,
my example is of course simplified. Given the following text I want to extracting all lines beginning with '#':
ab
#cd
ef
#gh
My grammar:
start = ( ( ! block . ) / block ) +
block = Result:( "#" identifier ) { return( Result ) } // 1
// block = Result:( "#" identifier ) { return( "Block: " + Result ) } // 2
// block = Result:( "#" identifier ) { return( "Block: " + Result[0] + Result[1].join("") ) } // 3
identifier = [a-zA-Z_]+
The result:
[
[
[
"",
"a"
]
]
[
[
"",
"b"
]
]
...
[
"#", // hint, not in output: Result[0]
[
"g", // hint, not in output: Result[1][0]
"h" // hint, not in output: Result[1][1]
]
]
]
How can I avoid all the in my case unnecessary output?
When I use the commented line 2 of my code, I get
[
...
"Block: #,g,h"
]
or with commented line 3
[
...
"Block: #gh"
]
And that "Block ..." is the only part I need.
Any hints/suggestions?
Many thanks and greetings
pegguy