trouble with question mark in regex

Thomas Michael Hagen <[email protected]>
Newsgroups gmane.mail.spam.crm114
Message-ID <[email protected]>
the usual behavior for ? is to make sure you capture the shortest
match. this does not seem to work in gerh.

this is my code:

match (:: :intro: :not-used: :text-chunk: :beginning-of-next-article:)
[:ffile:] /(#http:.*?(CET|CEST) ....)(.*?)(#http:|$)/

i am searching through a file that contains newspaper articles
beginning with a header that looks something like this:

#http://fotball.bt.no/eliteserien/article131749.ece
Wed Mar 11 19:08:07 CEST 2009

i want to capture these first two lines with the variable :intro:,
however, at the very end of each article (in some newspapers), there
is a field where the journalists put their name and a timestamp. it
looks like this:

S: trond
T: Mon Sep 25 18:14:15 CEST 2006

the problem is that my program completely ignores the first timestamp,
and puts the entire article into the :intro: variable.



this is the output of crm -v

 This is CRM114, version 20081111-BlameBarack, rev 4797 (TRE 0.7.5
(LGPL, APPROX, WCHAR, MULTIBYTE)) (OS: linux-gnu)
 Copyright 2001-2009 William S. Yerazunis
 This software is licensed under the GPL with ABSOLUTELY NO WARRANTY

Classifiers included in this build:
  all of 'em

Extra features:
  Developer Assertions are:
    - included
    - UNTRAPPABLE
    - '-Cdbg' will cause a memory access violation in a last ditch
      effort to trigger your debugger

Script language:
  Reserved words (instructions) + attributes / format:
accept
alius
alter      (...) /.../
call       (optional) [optional] /.../
cssmerge   <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
cssdiff    <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
cssbackup  <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
cssrestore <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
cssinfo    <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
cssanalyze <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace ...> (...) (optional)
        [optional] /optional/
csscreate  <nocase basic literal nomultiline byline bychar string bychunk
        microgroom markovian markov osb correlate winnow chi2 unique entropy
        entropic osbf hyperspace unigram crosslink default sks svm fscm neural
        alt.markovian alt.markov alt.osb alt.winnow alt.osbf alt.hyperspace
        ...> (...) (optional) [optional] /optional/
cssmigrate <basic bychar string microgroom markovian markov osb correlate
        winnow chi2 unique entropy entropic osbf hyperspace unigram crosslink
        default sks svm fscm neural auto autodetect alt.markovian alt.markov
        alt.osb alt.winnow alt.osbf alt.hyperspace> (...) [...] /optional/
eval       (optional) /.../
exit       /optional/
fail
fault      /optional/
hash       (...) /.../
input      <nomultiline byline lineedit> (optional) [optional]
intersect  (...) [...]
isolate    <default> (...) /optional/
lazy       <default> (...) /optional/
learn      <fromstart nocase basic literal nomultiline byline bychar string
        bychunk append refute microgroom markovian markov osb correlate winnow
        chi2 unique entropy entropic osbf hyperspace unigram crosslink sks svm
        fscm neural alt.markovian alt.markov alt.osb alt.winnow alt.osbf
        alt.hyperspace> (...) [optional] /optional/ /optional/
classify   <nocase basic literal nomultiline byline bychar string bychunk
        microgroom markovian markov osb correlate winnow chi2 unique entropy
        entropic osbf hyperspace unigram crosslink sks svm fscm neural
        alt.markovian alt.markov alt.osb alt.winnow alt.osbf alt.hyperspace>
        (...) (optional) [optional] /optional/ /optional/
liaf
match      <fromstart fromnext fromend newend fromcurrent nocase absent basic
        backwards literal nomultiline byline> (optional) [optional] /.../
mutate     <nocase absent basic nomultiline byline bychar string bychunk
        unique default ...> (optional) [optional] /.../
output     <append> [optional] /optional/
clump      <bychunk refute unique unigram> (...) (optional) [...] /optional/
        /optional/
pmulc      <bychunk refute unique unigram> (...) (optional) [...] /optional/
return     /optional/
routine
sort       <nocase basic backwards nomultiline byline bychar string bychunk
        unique default> (optional) [optional] /optional/
syscall    <keep async> (optional) (optional) (optional) [optional] /optional/

translate  <literal unique> (optional) [optional] /optional/ /optional/
trap       (optional) /.../
union      (...) [...]
window     <nocase literal bychar string bychunk byeof eofaccepts eofretry>
        (optional) (optional) /optional/ /optional/

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.