var/tmpName="WhatEveryOu want"
var/regex/R = new/regex("(^\[^A-Z]{1})(\[^A-Za-z\\s]{0,})(\[^a-zA-Z]$)")
if(R.Find(tmpName))
Problem description:
I have spent a good few hours trying to crack the regex code, and have only found the way in which I want the string to result, but simply cannot figure out how to detect if any of these following rules are NOT met.
1.) The first letter MUST begin with a capital.
2.) The string may not contain any text besides A-Za-z or a space.
3.) The string must not end with a space.
I am using this for name validation, as such.. All of the highlighted names in the above screenshot are to be considered valid. If any of the conditions are not met, it should (in theory) return the position in which it was found to be conflicting, which would throw a return value back.
Yet, if all conditions are met, it should not return anything at all.
tl;dr:
Regex confuses the hell out of me, what would be the best way for verifying the above rules with a simple if statement?
http://stackoverflow.com/a/2637899