Clay Icon

How to Write a Case-Insensitive Regex for Clay's Scrape Website Enrichment?

·
·

How do you write regex to be case-insensitive for Clay’s Scrape Website enrichment? For example, I’d like to write a regex that captures both “Business” and “business”. I tried /business/i using the case insensitive i flag; it does not work (no returned matches). However, when I try Business or business, it works.

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Can you try [Bb]usiness

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Sorry, I should’ve clarified that I’m looking for more general guidelines on what flavour of regex works and doesn’t work in Clay. Based on your suggestion, it sounds like the case-insensitive i flag does not work. What are other rules I should be aware of? Do you have any documentation on Clay’s regex rules that I can refer to when writing regex? Thanks for your help!

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Just bumping this again

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Hey Joe R. - sorry was out sick yesterday

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Just spoke to dev about this

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    They’re actually going to fix the Regex functions so its what’d youd typically expect

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Hey no worries, sorry for pinging you on a Saturday while you’re still recovering

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    as opposed to having little one off rules

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    and all good! Catching up on everything rn anyways

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    OK - any way I can get a list of one-off rules or is this fix going to be implemented really soon?

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Someone is going to try fixing that today

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    oh wow, ok. I’ll wait then; would appreciate it if you could keep me posted

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Yep will do!

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    thanks a lot!

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Hey Matthew Q.! Wanted to follow up to see if the regex revamp has been completed

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    hey this is fixed now!

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    also its case insensitive now by default

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Nice! ill give it a try

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Hey Matthew Q. - I see that the case insensitive filter is on by default now, thanks. But I’m running into other issues, which I’ve explained in a Loom here.

    1. 1.

      Scraper pulling a regex match when I can’t find the string in the source text

    2. 2.

      I still don’t know how to write regex in a way that Clay will understand. How do I write “TSA” and force Clay to only look for TSA as a stand-alone term and in all capitals?

    Would really appreciate your help

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Hey Arturo O. - would you be able to help here by any chance?

  • Avatar of Clay Team
    Clay Team
    APP
    ·
    ·

    Hey Joe! Sure, I'll take a look

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Hey Joe, sorry for the delay here - got lost in my messages. First off just added 1k credits for the lag here

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Looked into this a bit more - the regex does look often, couldn’t quite discern what’s going on. For the time being, I added our free integration that get’s keywords from a body of text. This is looking to be more accurate

  • Avatar of Matthew Q.
    Matthew Q.
    ·
    ·

    Will ned dev to check out this ticket further though to adjust the scrape website integration

  • Avatar of Clay Team
    Clay Team
    APP
    ·
    ·

    Yep, was checking this too. I was going to test out with formulas, using ai to generate a proper code to search for... not sure if it takes that as input though

  • Avatar of Joe R.
    Joe R.
    ·
    ·

    Matthew Q. hey you mentioned the bug was due to the scraper pulling CSS properties / values and that it was resolved. But seeing the same issue recur in the same table (showing “ocean” as a regex match for the first row). Could you please help look into this