Is "contains punctuation" known not to work?

These tests, with or without the “considering punctuation … end considering” block and with or without “as Unicode text”, always fails, and yet each of them compiles. [AS version 1.10.7; OS X 10.4.10; PowerMac G5.]

considering punctuation
	set T to {"this is a (line", "mercy, me", "hello!", "yes.", "minus-", "No Punct"}
	set P to {}
	repeat with I in T
		if ((contents of I) as Unicode text) contains punctuation then set P's end to true
	end repeat
	
	set L1 to ("this is a (line) mercy me hello! yes. minus- No Punct" as Unicode text) contains punctuation
	
	set L2 to ("Hello there, my name is Adam." as Unicode text) contains punctuation
	
	set L3 to "," contains punctuation
	
	set L4 to ("," as Unicode text) contains punctuation
end considering
---> all false.

and yet I swear I’ve got “true” somewhere else.

It compiles because it valid syntax. However, I don’t think you can get the behavior you’re looking for with contains.

{"a", 1, punctuation} contains punctuation
--> true

Hi Adam,

Bruce is right.
the enumeration constant punctuation can only be used in conjunction with considering/ignoring

Ahh, well. Thank you gentlemen – I’ll do it the “hard” way and check for membership in a list. :frowning: