I was trying to create a regular expression which validate !!
- If the text has only special character(s), or spaces , It should validate false …
Ex : @#$##
- If it has some text along with special characters at the end, it should return true…
EX : Test!!
- If it is starting with a special character apart from space or . It should validate to false.
Ex : @#Test
- If the special character, except space or coma, comes in between. it should validate to false !!
Ex : te#$ sT
I apologize that, for this complex regular expression, my knowledge do not allow me to put any code which I tried. Because I got nothing apart from [a-b A-B !@#$%^&*()]
UPDATE
- Testing with Fischermaen’s Answer – ^(\s|\w)\w*\W*$
sdf SDF! : Validate to false
___ : validate to true (Under scores)
sadf,sdfsdf : validate to false
Empty Spaces : Validate to true
Try this:
I got a headache trying to figure out what you meant. You must learn to express yourself better.
Explanation: