validation - regex'es to validate these -


regexes?

to validate name characters , spaces e.g.

jon skeet 

to validate number having digits , dashes anywhere e.g.

423-4324234-423 4233-412341324 

a basic english name:

([a-za-z]+\s*)+ 

numbers dashes anywhere except beginning , end:

\d[-\d]+\d 

numbers dashes anywhere:

[-\d]+ 

edit:

if looking name inside of sentence, such

hello, name john doe.

you can try , capture names based on 2 or more capitalized words in row.

([a-z][a-za-z]+\s*){2,} 

Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -