regexp with apostrophe

e-vee's icon

Dear all,

I would like the [regexp] object to read the apostrophes in words and pass it as one substring. For example "it's" should pass "it's", while now, it is read as two separate substrings: "it" and "s".

Any idea how to do this? I searched the web and this forum, but I still have no clue.

regexpHelp.zip
application/zip 2.03 KB
Patch + textfile

Roman Thilenius's icon


once a single closing quote was already used - and that is what most people use - you are lost.

http://snowball.tartarus.org/texts/apostrophe.html

Peter Ostry's icon

People and text sources use various characters as apostrophes. May be problematic to type the signs into [regexp]. Many programs like to translate the signs on their own and I guess you do not like to depend on the sources.

Better run your text through [atoi] before [regexp] and use the ASCII number(s) .

———

Example:

The characters
’‘'´`
are commonly used as apostrophes. Typed on a German Mac keyboard into a Max message box and sent through [atoi], they translate to 8217 8216 39 180 96.

8217 = right single quotation mark (German apostrophe)
8216 = left single quotation mark
39 = low ASCII single quote
180 = accent grave
96 = accent acute

e-vee's icon

Thank you both for your answer! I wasn't aware of the complexities surrounding apostrophes. :)
With [atoi], I found a solution for my problem (see attachment).

Have a good day!

regexpHelp_solution.zip
application/zip 2.65 KB