How can I find specific characters in a text? (eg, numbers, capitals)

This FAQ applies to someone looking for special characters in a text. For example: numbers, capitals, accented characters, etc.

There is not a built-in function in AppleScript, so you should use any regexp tool (scripting addition or “do shell script” call) or ellaborate your own method depending on your needs.

In this quick example, we will delete all found numbers in a text:

stripNumbers("I'm the number 1.") --> "I'm the number ."

to stripNumbers(inputText)
	set theNumbers to "0123456789"
	
	set prevTids to AppleScript's text item delimiters
	repeat with i in theNumbers
		set AppleScript's text item delimiters to i
		set inputText to inputText's text items
		set AppleScript's text item delimiters to prevTids
		set inputText to inputText as text
	end repeat
	
	inputText
end stripNumbers