Re: PKGBUILD parser

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



On Mon, May 10, 2010 at 8:14 PM, Pierre Chapuis <catwell@xxxxxxxxxxxx> wrote:
>>> http://stackoverflow.com/questions/133601/can-regular-expressions-be-used-to-match-nested-patterns
>>
> Actually if you read the page linked above completely you will notice that it says that you can. Regexps like POSIX that use finite automata can't but PCRE (that are everywhere) can, at least recent versions. That's also why they are slower.

oh, indeed, thanks! i somehow skipped all those and went straight to
read about CFG/PEG...

here's what seems to work in php (and i assume in many server side languages):
/^build\s*\(\)\s*(\{((?>[^{}]+)|(?R1))*\})/mx

sadly it (flag x) didn't work in any browser (js) i tested...

cheers
.andre


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux