Searching for a Regex to disable any "/" before the first letter -
i got angular form upload files on cloud, files in directories subdirectories
"directory/subdirectory/filename"
my form had inputs, , added ng-pattern on text input.
i can't accept sentence "/" @ first character
/directory/subdirectory/filename
i searching regex deny "/" until first letter of directory name.
so, correct way is:
directory/blabla;
and wrong way is:
/directory/blabla;
i tried [^/]* detect '/' in sentence.
any idea please ?
this should do: ^[^\/]\s+$
the regex checks first character not '/', , accepts every non-whitespace character till end.
Comments
Post a Comment