Javascript Regex match no spaces?

Change your regex to this: /^PC\d+$/ This requires at least one digit and only matches if there is nothing else in the string except the PC and the digits. This will match: PC123456 PC1 PC99 It will not match: PC 12345 PC PCx1234.

You need to add an end-of-source anchor: /^PC\d*$/ The "$" at the end insists that the pattern match the entire string. Without it, "PC" with no immediately subsequent digits matches because "*" means "zero or more", not "one or more". You could alternatively change the "*" to a "+", but I don't know whether "PC" by itself is valid in your application.

Require at least one digit after PC /^PC\d+/ or require the String to last the entire line /^PC\d*$.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions