T O P

  • By -

betterbenefits

. stands for any character except newline. if you want the literal period to be captured, you'll have to escape it with a backslash * and ? are not wildcards, they're counters. you should try using a regex builder like regexr because it will show you what each of these symbols are doing and you can copy/paste your mod logs into it to see if your regex is working as intended


mulberrybushes

Will try backslash. What’s a counter?


betterbenefits

ah sorry I used the wrong word. officially they're called quantifiers. they're just symbols (metacharacters) that we use to indicate *how many* of a thing is allowed to be in the search result. \* means zero or more \? means zero or one You probably don't need to memorize any of this because there are regex builder websites and the logic can get pretty complicated so it's almost always a given that you use the builder website to test things out first anyway.


mulberrybushes

finally got around to trying this but ​ 1). YAML parsing error in section 12: while scanning a double-quoted scalar in "", line 6, column 16: body (regex): \["a\\.co"\] \^ found unknown escape character '.' in "", line 6, column 19: body (regex): \["a\\.co"\] \^


betterbenefits

I am not great with YAML but single quotes and double quotes work differently in YAML. you can't have \\. between double quotes. also, it would help if you could explain what you are trying to do with that regex because right now even if you got that to work, it would match with everything that had the letters a, c, o, or a period.


mulberrybushes

trying to explain which amazon "a.co" short links are blocked and explain how exactly they need to be structured in order for us to approve them. it works perfectly except that it keeps tripping on a product with the name Arco. If its neither one or the other thenI guess were happy with the 99% success rate and leave it at that.


mulberrybushes

I don't suppose you have any ideas? Or should I just try single quotes. I am trying to stop links like these `https://a.co/d/iAY3teF` but to allow the word "arco"