[erlang-questions] sytax of atoms

Robert Virding <>
Sun Apr 15 19:16:42 CEST 2007


Sigh. I'm easy :-) :

[a-z][A-Za-z0-9_-@]*
'(\\\^.|\\.|[^'])*'

The dot should not be there because, as Richard Carlsson pointed out, 
that a.b is actually tokenised as three tokens 'a' '.' 'b' and then 
combined in the parser*. N.B. no spaces allowed after '.'.

Robert

* For those interested the actual scan is {atom,1,a},{'.',1},{atom,1,b}.

Julian Fondren wrote:
> On 4/15/07, Robert Virding <> wrote:
>> As regular expressions for leex:
>>
>> [a-z][A-Za-z0-9_-.]*
>> '(\\\^.|\\.|[^'])*'
> 
> counterexample: 
> 



More information about the erlang-questions mailing list