lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2013-10-11 2:10 PM, "Scott Fial" <scott@fial.com> wrote:
>>
>> but what is the best way of doing the same thing for a string where the
>> delimiter is ;;, e.g.
>>
>> s = "a;;b;;c"             (where a, b and c can be any length and can
>> include non repeating occurrences of ; )
>
>
> The encoding format seems ambiguous. E.g.,
>
>   Input 1  |  Input 2  | Encoded
>   ---------+-----------+--------
>      a;    |     b     |  a;;;b
>      a     |    ;b     |  a;;;b
>
> There is no way to parse a;;;b and be guaranteed to recover the original inputs.
>
> Scott
>

For that matter, none of the inputs can contain ';;'. But perhaps OP doesn't have control of the format.