I need a regular expression that will search in a string for valid characters. The only allowed (but not mandatory to appear)characters in this string are letters,digits, # and . (period) and they can appear in any order within the string. Any other character would be invalid. All i want to do is check for valid characters and i dont care where it appears. Some valid expressions are abc123.#, abc,123#.a etc..I started off with this regex "^*[a-zA-Z0-9#*.]", but if i enter "@#$%^", this regex returns true. I also tried "^*![a-zA-Z0-9#*.]", but this forces me to have all the above characters in that string.
What am i missing?
I appreciate any help