Regular expression (regex) required

I want to block all special characters except alphanumerics.. and "."(dot ) character

currently am using /[^a-zA-Z.]/

I want to even block only single dot or multiple dots..

ex:
. or .............. should be blocked.

please provide me the reg ex.

---------- Post updated at 05:11 AM ---------- Previous update was at 04:19 AM ----------

am trying =>[^a-zA-Z .{1}] . this is not working

Please provide me the solution asap

can you please elaborate this?
better give an example.

choose the test you want from below:-

example:-

shopt -s extglob

INPUT="Ad123"

case $INPUT in
   ( +([[:digit:]])  ) echo "$INPUT is all numbers" ;;
   ( +([[:alpha:]])  ) echo "$INPUT is all characters" ;;
   ( +([[:alnum:]])  ) echo "$INPUT is alphanumeric" ;;
   (                *) echo "$INPUT is empty or something unknown" ;;
esac
o/p
Ad123  is alphanumeric

@anchal

in first name field I want to block multiple dots
ex:

FirstName should not be => . (dot)or .......(multiple dots)

it can be => a.b.c.

am using => split( [^a-zA-Z0-9.] )

But it does not work:mad:

provide i/p and desired o/p that means an example.

Hello,
what do you mean by this "I want to even block only single dot or multiple dots..
". this implies that you dont want dots at all?
the regex that you are trying is absolutely wrong.
In (character class) {}(counter) doesnt work. except it becomes a literal.
([^a-zA-Z]) implies that these alphabets are not included contrary to the one you have stated above. -> "want to block all special characters except alphanumerics.. "..

are you sure you should allow single dot at the end?
if yes, this should work ( please test first)

^([a-zA-Z0-9]+\.?)+$

if you dont want dot at the end:

^([a-zA-Z0-9]+\.?)+[^.]$

I want to allow alphanumeric characters and single dot in between the characters,multiple dots should not be allowed.

ex :
1 . (single) dot should not be allowed in the string
2. ...... (multiple dots should not be allowed in the string)
3. a.b.c (dots in b/w the characters can be allowed)
4. special characters other than alphanumeric characters should not be allowed

regex should pass the above mentioned criteria

Please test this:

^([a-zA-Z0-9]+\.?)+[a-zA-Z0-9]+$

How about:

egrep -v "([^a-zA-Z0-9.]|^\.|\.\.|\.$)"

The following is the jquery code.
Here am reading the values entered in the text box and evaluating that string.

variable fName contains the original string here .

$("#fName").blur(function(){
        var fName = jQuery.trim($("#fName").val());   // removing white spaces
        var words = fName.split(/[^a-zA-Z0-9.]/);   // allowing only alphanumerics and //.(dot character) here
  
        nfName = jQuery.trim(words.join(" "));   // again joining the string
        if(nfName != fName)
        {
                alert("Special characters other than \".\" are not allowed");       
        }       
});

am able to block all special characters except .
but i want the following criteria to be passed.

ex :
1 . (single) dot should not be allowed in the string i.e (complete string should not be single dot)
2. ...... (multiple dots should not be allowed in the string) i.e (string should not be only dots)
3. a.b.c (dots in b/w the characters can be allowed)
4. special characters other than alphanumeric characters should not be allowed

please post the ideas.