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?)
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