Can someone help me with a simple regex issue? I've tried searching online but couldn't find a suitable example. I'm struggling with regex and just need to ensure that an input contains more than 1 character (i.e. is not blank). My code uses Angular's ng-pattern directive.
<input type="text" ng-model="username" ng-pattern="/regex/">
I want to make sure there is something in the input (not empty). I've tried a few examples, but the problem is that even after clearing the input, Angular still recognizes it as valid. I need it to fail if the input becomes empty again, but not on initial load. Any assistance would be greatly appreciated.
EDIT: Basically, I need a regex that will check if the field is not blank. You can view my plnkr example here.