alert( /([ABC]).*(?!\1)([ABC]).*(?!\1|\2)[ABC]/ .test(prompt('test string', '4 B 5345 A dfdf #$@% C fdhd')))