Home > Blockchain >  RegExp for the following
RegExp for the following

Time:01-10

It should have a minimum of one word and each word should start with an uppercase alphabet and contain only the alphabet.

I have this is mind:

(^[A-Z][a-z ] )([A-Z][a-z] )

But it's limited to only 2 Word example Alex Johnas and as soon as write for example Alex Johnas Junior its throw an error.

CodePudding user response:

I hope this helps:

/([A-Z][a-z] \s?) /

It searches for words which begin with capital letters (\s? is used, so the last word will also get matched).

  • Related