GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Oriel Jutty :hhHHHAAAH: (barubary@infosec.exchange)'s status on Thursday, 05-Dec-2024 03:35:53 JST Oriel Jutty :hhHHHAAAH: Oriel Jutty :hhHHHAAAH:

    AoC day 4. Still pretty simple to solve with a couple of regexes. The hardest part was remembering to add the g flag to all matches.

    use v5.36;

    $_ = do { local $/; readline };
    my $n = index $_, "\n";
    my $m = $n - 1;
    my $o = $n + 1;
    say
    + (() = /XMAS/g)
    + (() = /SAMX/g)
    + (() = /X(?=.{$n}M.{$n}A.{$n}S)/sg)
    + (() = /S(?=.{$n}A.{$n}M.{$n}X)/sg)
    + (() = /X(?=.{$m}M.{$m}A.{$m}S)/sg)
    + (() = /S(?=.{$m}A.{$m}M.{$m}X)/sg)
    + (() = /X(?=.{$o}M.{$o}A.{$o}S)/sg)
    + (() = /S(?=.{$o}A.{$o}M.{$o}X)/sg)
    ;
    say
    + (() = /M(?=.{$o}A.{$o}S)(?=[^\n]M.{$m}A.{$m}S)/sg)
    + (() = /M(?=.{$o}A.{$o}S)(?=[^\n]S.{$m}A.{$m}M)/sg)
    + (() = /S(?=.{$o}A.{$o}M)(?=[^\n]M.{$m}A.{$m}S)/sg)
    + (() = /S(?=.{$o}A.{$o}M)(?=[^\n]S.{$m}A.{$m}M)/sg)
    ;

    #AdventOfCode #perl

    In conversation about 7 months ago from infosec.exchange permalink

    Feeds

    • Activity Streams
    • RSS 2.0
    • Atom
    • Help
    • About
    • FAQ
    • TOS
    • Privacy
    • Source
    • Version
    • Contact

    GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

    Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.