firstruby

Master ruby with us

Posts Tagged ‘RegEx’

Regular Expression to skip alphabets, accepts numbers and few characters

Posted by firstruby on February 20, 2011

Following is the Regular expression which accepts numbers, plus (+), miuns (-) symols and skips alphabets,

RegEx:   /\A[+\-0-9]+\z/

This RegEx can be useful for Phone number validation.

Advertisements

Posted in Useful Links | Tagged: , | Leave a Comment »