[ale] VI vs perl RE question

attriel attriel at d20boards.net
Wed Feb 1 23:32:02 EST 2006


>>([a-z]+)? means some number of lowercase letters.  Maybe.
>>([a-z]+?)fred means lowercase letters up to the first occurrence of
>> "fred"
>>([a-z]+)fred looks for lowercase followed by fred, but not necessarily
>> the
>>first fred.
>
> Does + mean the same thing it does in grep/vi? That is, "one or more
> of the preceding expression"?  If so, it appears "?" can mean
> different things depending on how it's used: in the first example, above,
> it seems to mean "the previous thing is optional", whereas in
> the second example, it seems to mean "don't be greedy".
>
> ?

that is precisely what's happening yeah.

Or:  What fletch said :)

Basically by itself it means "0-1", appeneded to something else it means
"whatever that said, but as small as I can make it"




More information about the Ale mailing list