[Gambas-user] Help with RegExp

tobias tobiasboe1 at ...20...
Sat Sep 24 00:14:50 CEST 2011


hi,

i have a problem with regular expressions: i'm not very good in using them.
i want to determine the comment string in a gambas comment with gb.pcre 
and been sitting down for 3 hours now, totally frustrated...
i thought, i have to search for the first ' apostrophe from the left 
which isn't between "". i have experimented with the ugliest things but 
nothing worked properly.
i used these lines to test:

Print "'" '"'"
Print "text" 'comment
and the line of RegExp.Compile(???) itself

of course, they should give
"'"
comment
(nothing)

i got a solution that matched the first two ones correctly but no chance 
for the regexp itself in line 3 (i always got something after the 
apostrophe in the regexp)...

i didn't get very far without getting wrong results, so i think there's 
no need to post my tries
i would be very glad if someone more experienced could help me.

regards,
tobi





More information about the User mailing list