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

From: Vincent Veyron <[email-masked]>
Date: Wed, 26 Nov 2025 16:43:56 +0100

On Wed, 26 Nov 2025 07:10:16 -0800 (PST)
Rich Shepard <[email-masked]> wrote:

> 
> Learning postgres regexp is at the top of my list.
> 

https://perldoc.perl.org/perlre

Read the first few pages and you'll be good to go.

-- 
					Bien à vous, Vincent Veyron 

https://marica.fr/ 
Logiciel de suivi des contentieux juridiques, des sinistres d'assurance et des contrats

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 26 Nov 2025 08:52:03 -0700

> Read the first few pages and you'll be good to go.

I was using this tool a while back when I was doing heavy regex work.

https://www.regexbuddy.com/

Keep in mind the native flavor of regex in PostgreSQL is TCL, not Perl.

But I’d still say regexp is not the best solution here - unless you
encapsulate the logic in a function.  I suspect you’ll want to use this
logic in more than just a single query and with a literal regexp you have
to rely on manual synchronization.  Note, you could combine the lookup
table with regexes.  Though beware of ensure you don’t produce duplicate
matches if you go that route.

David J.

---

From: Rich Shepard <[email-masked]>
Date: Wed, 26 Nov 2025 08:08:55 -0800 (PST)

> Read the first few pages and you'll be good to go.

Thanks, Vincent.

Rich

---

From: Rich Shepard <[email-masked]>
Date: Wed, 26 Nov 2025 08:10:54 -0800 (PST)

> matches if you go that route.

David,

Thanks,

Rich

---

From: Bryan Sayer <[email-masked]>
Date: Wed, 26 Nov 2025 12:01:46 -0500

I am not very skilled at Postgresql specifically, but when I was doing 
SQL in another environment I would just do

select distinct (or unique) jobtitle

usually getting a count of how many times each title occurred. Then I 
would create a mapping to standardize the the job titles.

*Bryan Sayer*
Retired Demographer/Statistician
/In a world in which you can be anything, *be kind*/

---

From: Jacqui Caren <[email-masked]>
Date: Fri, 28 Nov 2025 10:19:43 +0000

Many years ago I used a weak precedence engine to categorize this form of
job title script to a job code.

The regexp did not work because we had asst to gen mgr
The wpe tokenized the words then relaxed token patterns with other token
codes with cumulative context
The final token reduction resulted in a final code or if in my example we
had a modifier to role code (asst to xxxx role)

The entire engine was created in Oracle but would be easy to implement in
pgsql. Back then neural nets were only just appearing in finance and llms
were non existent.

Old 1960's tech saved the day

On Wed, Nov 26, 2025, 17:02 Bryan Sayer <[email-masked]> wrote:

> I am not very skilled at Postgresql specifically, but when I was doing SQL
> in another environment I would just do
>
> *In a world in which you can be anything, be kind*