help-gawk
[Top][All Lists]
Advanced

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

Re: regex for roman numerals


From: Peng Yu
Subject: Re: regex for roman numerals
Date: Tue, 7 Mar 2023 11:01:59 -0600

That is what I thought. My guess is that awk regex is not powerful
enough to capture roman numerals.

https://www.tutorialspoint.com/roman-to-integer-in-python

Here is a python program that recognizes roman numerals. I don't see
how regex in awk can have the ability to capture this logic.

On 3/7/23, Wolfgang Laun <wolfgang.laun@gmail.com> wrote:
> Just for a puzzle: I claim that the requirement to determine whether a
> string contains exactly one roman numeral (according to the rules for
> ancient numerals or for medieval rules - take your pick) cannot be met in
> awk with one single regular expression and no additional code.
> But it can be done in some other regex implementations, e.g. Perl, Java,
> Python.
>
> Cheers
> -W
>
>
> On Tue, 7 Mar 2023 at 09:11, Manuel Collado <mcollado2011@gmail.com> wrote:
>
>> El 6/3/23 a las 21:45, Peng Yu escribió:
>> > Hi,
>> >
>> > I see there are some discussion online about regex for roman numerals.
>> > But I don't find a discussion specific for awk. What is the regex for
>> > roman numerals in awk?
>> >
>>
>> The same as in any other application that use regexes.
>>
>> --
>> Manuel Collado - http://mcollado.z15.es
>>
>>
>
> --
> Wolfgang Laun
>


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]