Mayank Modi Mayank Modi - 19 days ago 7
iOS Question

Regex for leave blank text field else enter only valid detail

I want regex for checking text field string ,for two conditions in only one regex, A user can leave text field full blank or enter valid numbers/alphabets/mobile number only.

please reply me soon I tried more ways.

Answer

@"^[\s]$|^[0-9]$" //regex for either space or number @"^[\s]$|[A-Za-z]+[[\s][A-Za-z]+] //regex either space or alphabate