Page 1 of 1

creating a pattern expression for words ending 's

Posted: Sat Jul 11, 2020 5:46 pm
by ecclesr
First time creating pattern subroutine expressions

My data has words like

MENS HOUSE
MEN'S HOUSE

I would like to create an expression in the Apostrophes SUBROUTINE that would handle words ending with 'S and replace with just S e.g. MENS

Thanking you all in advance

Posted: Sat Aug 01, 2020 4:12 pm
by ray.wurlod
I'm unable to check at the moment, but isn't there an apostrophes subroutine in the xxNAME rule sets that you could adapt?

Otherwise, use a conditional pattern to identify a token that ends in "'S" and replace that part of the pattern with "S". Something like

Code: Select all

* | ' | S
  COPY [1] temp 
  CONCAT [3] temp
  RETYPE [2] 0