<input type="text" name="address" pattern="[0-9a-zA-Z ,\.\/\-&']{0,}">
It will allow all except of few special characters but i don't want '//' '///' or any special character repetition like this. what should i change ?
You need to re-write the pattern as
pattern="(?:[0-9a-zA-Z]*(?:[ ,./&'-][0-9a-zA-Z]+)*)?"
See JS demo:
<form>
<input type="text" name="address" pattern="(?:[0-9a-zA-Z]*(?:[ ,./&'-][0-9a-zA-Z]+)*)?">
<input type="submit">
</form>
Note that ^ and $ are added by default, but in case you are using some additional frameworks that override the pattern attribute, you need to add the anchors to the pattern explicitly:
^(?:[0-9a-zA-Z]*(?:[ ,./&'-][0-9a-zA-Z]+)*)?$
Details:
^ - start of a string(?:[0-9a-zA-Z]*(?:[ ,./&'-][0-9a-zA-Z]*)*)? - an optional non-capturing group matching 1 or 0 occurrences of:
[0-9a-zA-Z]* - zero or more ASCII letters/digits(?:[ ,./&'-][0-9a-zA-Z]*)* - 0 or more occurrences of:
[ ,./&'-] - a space, ,, ., / (no need to escape it!), &, ' or - (no need to escape it at the end of the character class, but you can)[0-9a-zA-Z]+ - one or more ASCII letters/digits$ - end of string.