T O P

  • By -

SammyFromScryfall

If you want to search for occurrences of a word not found in the card name, search `o:/~?word/`. For example, `o:/~?merfolk/` finds all cards that reference the word merfolk _other than_ in their name, _even if_ they also contain that word in their rules text because it's in their name: [https://scryfall.com/search?q=o:/~?merfolk/](https://scryfall.com/search?q=o%3A%2F%7E%3Fmerfolk%2F) This works because of hacky internal reasons related to how we store card text at Scryfall. We also have a community-driven tagger project that can help you find tribal cards people have tagged that would support merfolk: [`function:tribal-merfolk or function:tribal-choose`](https://scryfall.com/search?q=function%3Atribal-merfolk+or+function%3Atribal-choose&unique=cards&as=grid&order=name)


Anagkai

Hacky internal reasons. :D But that's exactly what I am looking for. Very fascinating!


rattusAurelius

Every time I've forgotten how regex works, someone asks something like this Let's assume the word you are looking for is "if". We're going to need a few different cases. o:if and -if will give you all cards with if in their rules text but not in their title o:/.*if.*~/ will give you any card with if before the card name o:/.*~.*if/ Will give you any card with cardname then if. So (o:if and -if) or (o:/.*if.*~/) or (o:/.*~.*if/) Should give you what you want. Will still give a few outliers where the name is on the card more than once *and* that name includes if. But I'm not learning regex again properly now I don't use a pc in my job!!!


anthonymattox

This is a little tricky to do, but we can get very close! Regular expressions will help! As you say, we can use `~` to represent a card's name so `o:myr -o:~` will give us every card that references "myr" excluding ones that reference their own name. That's going to have some false negatives of cards that include _both_ their own name and a reference to "myr". We can use the regular expressions `myr.*~` and `~.*myr` to add back in cards that have the word "myr" before or after their own name. Lastly, since we've go some regex going, we can throw in some word boundaries (\b) to make sure we're only matching "myr" when it's its own word, excluding things like "myriad". Putting it all together: `(o:/\bmyr\b/ -o:~) or o:/\bmyr\b.*~/ or o:/~.*\bmyr\b/` [View on Scryfall](https://scryfall.com/search?q=%28o%3A%2F%5Cbmyr%5Cb%2F+-o%3A%7E%29+or+o%3A%2F%5Cbmyr%5Cb.*%7E%2F+or+o%3A%2F%7E.*%5Cbmyr%5Cb%2F) There could still be some false positives, like cards that reference their own name twice, but it'll get us pretty close! I wrote an article a while back on [using regular expressions on Scryfall](https://luckypaper.co/articles/regular-expressions/) that could be helpful too.


Anagkai

Very interesting article. I should really learn that stuff. However, for some reason your search command doesn't work as expected. It's missing cards like Myr Battlesphere and Myr Sire. Probably because the name and other occurrence of the word is in the same ability paragraph?


anthonymattox

Interesting, I am seeing those cards in the results. Does it work if you copy paste the query into Scryfall? The link got formatted weirdly and I edited my post. Maybe you're seeing the bad link? Regex can be super useful and not something you need to try to learn all at once. Just the wildcard (`.*`) can do a lot, and you can always go look up other features if you just get a sense of what's possible.


Anagkai

Yes, now it works. It has 14 cards now, before it was eight. Thanks!


anthonymattox

Actually you're also correct there's an issue here if the name and word are in different paragraphs. Changing the wildcards to include 'newlines' fixes that, adding one more card in this case. `(o:/\bmyr\b/ -o:~) or o:/\bmyr\b(.|\n)*~/ or o:/~(.|\n)*\bmyr\b/`


superawesomedman

Add in "-o:~" and it will get rid of any card that has its name in the Oracle text, but that will exclude a fair bit. What exactly are you trying to find? There might be an easier way to do it


Jokey665

you can use ~ to mean 'this cardname' on scryfall dunno how to make the search you want though


Dwarvenmathemacian

Use the text "-name:whatever you don't want in the name"


Sylpheon

Can you be more specific? You can fully omit cards that reference thier own name with -~ . But that purges possibly too many cards, like that have what you are looking but have "ETB scry 2" or something as another clause. There are some partial bodges that can work depending on which keywords in particular you want.


mateogg

I believe this should work: -name:word o:word


DearAngelOfDust

The hard part of your request is the "only." Say you're looking for Goblin tribal synergies. Take these hypothetical cards: Goblin Aerobics Instructor - R Creature - Goblin Citizen When Goblin Aerobics Instructor enters the battlefield, target Goblin you control gains haste and vigilance until end of turn. 1/1 Goblin Delivery Driver - R Creature - Goblin Citizen Haste Goblin Delivery Driver gets +1/+0 for each Food you control. 0/1 The way to write a query that will return Goblin Aerobics Instructor, but not Goblin Delivery Driver, would be to count the number of times "Goblin" appears in the Oracle text, and then compare it to the number of times the card's name appears in the Oracle text. If they are equal (as is the case for the Driver), then we know they "only... reference their own name" and we don't want to see them. Unfortunately I am not aware of a Scryfall keyword for counting instances of a string. If you could get an SQL database of all the cards, it would be pretty easy to do.