regex problem

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 109
Joined: Thu May 03, 2012 7:22 am

Sat Jun 08, 2013 12:37 am

Hey guys, I really really suck at regex but I need one asap. The rules are:
- can contain only alphanum chars and underscore;
- must begin and end with a letter (not underscore or number);
- no spaces;

I need this to validate a field. Thanks, cheers ^_^

New php-forum User
New php-forum User
Posts: 8
Joined: Mon Feb 17, 2014 8:53 pm

Mon Feb 17, 2014 9:26 pm

This should do it:

Code: Select all

Note that this requires your data field to be at least two characters long.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests