#bookbrainz

/

      • G0d joined the channel
      • 2025-11-12 31623, 2025

      • ApeKattQuest
        hmm.logging in on both prod and beta is very slow right now, is this a known thing or
      • 2025-11-12 31619, 2025

      • monkey[m]
        Probably related to overall MetaBrainz issues, if I had to guess. I've had login issues on multiple projects in the past week
      • 2025-11-12 31655, 2025

      • ApeKattQuest
        hm how do we do underlined text in the markup again?
      • 2025-11-12 31657, 2025

      • shoesNsocks joined the channel
      • 2025-11-12 31638, 2025

      • ApeKattQuest
        waait I just realised I could possibly fix BB-870 myself, https://bookbrainz.org/identifier-type/23/edit what should I edit the Detection RegEx and Validation RegEx with? (can replace just "authors" with "*" work?)
      • 2025-11-12 31639, 2025

      • BrainzBot
        BB-870: Issue with linking openlibrary author https://tickets.metabrainz.org/browse/BB-870
      • 2025-11-12 31643, 2025

      • ApeKattQuest
        wait let me test on test
      • 2025-11-12 31610, 2025

      • ApeKattQuest
        wait I think I did it!
      • 2025-11-12 31657, 2025

      • ApeKattQuest
        ok so it WORKS
      • 2025-11-12 31659, 2025

      • ApeKattQuest
        hehoo
      • 2025-11-12 31600, 2025

      • monkey[m]
        Nice ApeKattQuest (IRC) !
      • 2025-11-12 31603, 2025

      • monkey[m]
        Although...
      • 2025-11-12 31620, 2025

      • ApeKattQuest
        ops
      • 2025-11-12 31629, 2025

      • ApeKattQuest
        there's probably better ways lol
      • 2025-11-12 31631, 2025

      • monkey[m]
        I think now pasting an OL author link doesn't work anymore
      • 2025-11-12 31639, 2025

      • ApeKattQuest
        huuuhhh
      • 2025-11-12 31641, 2025

      • ApeKattQuest
        oh no
      • 2025-11-12 31643, 2025

      • monkey[m]
        No no, I think you are absolutely correct with the solution
      • 2025-11-12 31653, 2025

      • monkey[m]
        Let me check the regex
      • 2025-11-12 31658, 2025

      • ApeKattQuest
        lol
      • 2025-11-12 31601, 2025

      • ApeKattQuest
        shait that shouldn't break it because a|b should be "matched a or b according to https://regexr.com/
      • 2025-11-12 31633, 2025

      • monkey[m]
        For reference, I usually use this to test regexps, and always test with all examples I have at hand because regexps are HARD
      • 2025-11-12 31633, 2025

      • monkey[m]
      • 2025-11-12 31606, 2025

      • ApeKattQuest
        yea uh I don't know this
      • 2025-11-12 31624, 2025

      • ApeKattQuest
        what is d+?
      • 2025-11-12 31642, 2025

      • monkey[m]
        OK, I fixed the regex, it needed a "non capturing group" around authors|work
      • 2025-11-12 31643, 2025

      • ApeKattQuest
        the A is for A at the end of the entity
      • 2025-11-12 31648, 2025

      • monkey[m]
        openlibrary\.org\/(?:authors|works)\/(OL\d+?A)
      • 2025-11-12 31658, 2025

      • ApeKattQuest
        what does non capturing mean?
      • 2025-11-12 31616, 2025

      • ApeKattQuest
        i need to learn regex properly orz
      • 2025-11-12 31647, 2025

      • monkey[m]
        ApeKattQuest: See in the top right "explanation" panel, it explains each token:
      • 2025-11-12 31647, 2025

      • monkey[m]
        `\d matches a digit (equivalent to [0-9])`
      • 2025-11-12 31647, 2025

      • monkey[m]
        `+? matches the previous token between one and unlimited times,`
      • 2025-11-12 31659, 2025

      • ApeKattQuest
        what aprt of the regex makes it ignore the bit after the OL2165055A bit?
      • 2025-11-12 31620, 2025

      • ApeKattQuest
        I'll look at this now
      • 2025-11-12 31639, 2025

      • ApeKattQuest
        so this will let me test regular expresions so i cna make thme work before pasting? oohh neat
      • 2025-11-12 31602, 2025

      • monkey[m]
        a capturing group means at the end you extract whatever is in the capturing group (in our case we ahe the OL ID captured).
      • 2025-11-12 31602, 2025

      • monkey[m]
        A non capturing group allows you to say, in this case, it should be one of "authors" or "works", but don't extract that value cause I'm not interested in it
      • 2025-11-12 31648, 2025

      • ApeKattQuest
        aha, since we already spesify it in the display template
      • 2025-11-12 31611, 2025

      • monkey[m]
        ApeKattQuest: Basically, the regex extracts what matches the capturing group, doesn't capture the rest
      • 2025-11-12 31644, 2025

      • ApeKattQuest
        why does "works" work tho ?
      • 2025-11-12 31602, 2025

      • ApeKattQuest
        oh becasue it was second?
      • 2025-11-12 31613, 2025

      • ApeKattQuest
        openlibrary\.org\/works|authors\/(OL\d+?A) seems to work on authors but not works
      • 2025-11-12 31639, 2025

      • monkey[m]
        Because of the construction of the regex, it can translate as: either match "openlibrary\.org\/authors" OR match "works\/(OL\d+?A)"
      • 2025-11-12 31603, 2025

      • ApeKattQuest
        yes, that's what I wanted
      • 2025-11-12 31616, 2025

      • monkey[m]
        Adding the non-capturing group ensure the "OR" part only applies to "authors" or "works"
      • 2025-11-12 31625, 2025

      • ApeKattQuest
        oh!
      • 2025-11-12 31634, 2025

      • ApeKattQuest
        so not "author or works or OL### or
      • 2025-11-12 31636, 2025

      • monkey[m]
        You got it ? Difference is subtle
      • 2025-11-12 31615, 2025

      • ApeKattQuest
        so a non apturing grou is (?:foobar|foobas) and a capturing group is (blup|blup)
      • 2025-11-12 31619, 2025

      • monkey[m]
        What you wanted is either match "openlibrary.org/authors/OL.....A" OR match "openlibrary.org/works/OL.....A"
      • 2025-11-12 31655, 2025

      • monkey[m]
        ApeKattQuest: Almost, the bar in the middle is not part of the concept of groups, that's the "OR" part
      • 2025-11-12 31605, 2025

      • ApeKattQuest
        yea
      • 2025-11-12 31623, 2025

      • ApeKattQuest
        whats the sign for *and*
      • 2025-11-12 31638, 2025

      • monkey[m]
        But "(?:something)" will match but not capture "something", while "(something)" will match and capture "something"
      • 2025-11-12 31654, 2025

      • ApeKattQuest
        nothing this!
      • 2025-11-12 31600, 2025

      • ApeKattQuest
        noteing*
      • 2025-11-12 31639, 2025

      • monkey[m]
        There is also a "Quick reference" panel on the right at the bottom which is absolutely necessary for people like me who use regexp once in a while and not everyday
      • 2025-11-12 31612, 2025

      • monkey[m]
        Let me tell you, learning regexps is a journey...
      • 2025-11-12 31628, 2025

      • ApeKattQuest
        lol
      • 2025-11-12 31639, 2025

      • monkey[m]
        But you feel powerful once you manage to craft the esoteric incantation that does the magic you wanted it to do
      • 2025-11-12 31644, 2025

      • ApeKattQuest
        thanks for this site I'll test regexes here before employing in the future