Regular expression that accepts only letters, spaces in between words and hyphens after word

65
March 03, 2021, at 00:50 AM

I'm trying to write a regular expression to capture what I mentioned above but for the hyphen part, it seems like it still matches words that start with a hyphen.

Here's what I wrote: ^[a-zA-Z0-]*$

Also, it doesn't seem to work with spacing in between words either.

Here is my refiddle: http://refiddle.com/p8os

I added this to an input "First Name" field and would like for it to only capture the person's name and if applicable, along with a hyphen.

Thanks for your help

READ ALSO
Importing whole SVG images folder from another direction

Importing whole SVG images folder from another direction

I want to import whole folder with my SVG icons from another directionFor now i know how to import a single file one by one

38
Xamarin Android On tab on push notification app not launched if in background or killed

Xamarin Android On tab on push notification app not launched if in background or killed

i am using both notification and data payload for push notificationit is working find if app is running

59
Does Google Big query Node library uses gRPC

Does Google Big query Node library uses gRPC

I would like to know if Google Node library uses gRPC or notI don't find any option to raise Question against Git repo so looking for guidance here

40
Pythin flappy game [closed]

Pythin flappy game [closed]

Want to improve this question? Update the question so it's on-topic for Stack Overflow

75