Subject: Re: Selecting all variations of job title in a list

From: Ron Johnson <[email-masked]>
Date: Tue, 25 Nov 2025 11:49:36 -0500

On Tue, Nov 25, 2025 at 11:33 AM Rich Shepard <[email-masked]>
wrote:

> Companies can have slightly different titles for the same job; for example
> (using abbreviations). 'Asst Gen Mgr.', 'Env Mgr,', 'Gen Mgr,'. 'Mgr,',
> 'Plant Mgr.'
>
> I want to select all people table rows that contain these varieties. I know
> the 'like' operator uses '%' as a wildcard, but is not accepted in an 'in'
> list.
>
> Is there a way to use a multicharacter wildcard in an 'in' list?
>

Maybe regex_match() with a bunch of OR clauses.

In bash, I'd do something like:
grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr..*'
foo.txt

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Rich Shepard <[email-masked]>
Date: Tue, 25 Nov 2025 11:05:34 -0800 (PST)

> grep -E ' ^Asst Gen Mgr.*|^Env Mgr.*|^Gen Mgr.*|^Mgr.*|^Plant Mgr..*'

Ron,

I've not used regex in postgres before, only in emacs and small languages.
So I'll learn how to do this. I was trying to avoid multiple OR clauses, but
that script will not be run often so it should not matter.

Thanks,

Rich