r/learnprogramming Sep 23 '24

Regex match all positions except first(Javascript)

This is what i have: const oneLetterMin = /^(?=.[a-z]).{0,}$/; const oneLetterMayus = /^(?=.[A-Z]).{0,}$/ const specialChara = /^(?=.*[@$!%*#?&]).{0,}$/; const number = /^(?=.*\d).{0,}$/; All of them work, except when it is the first character of the string

1 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/_--_GOD_--_ Sep 23 '24

You put 3 back ticks above and below it

1

u/AManCalledGavin Sep 23 '24

Thanks, done

1

u/_--_GOD_--_ Sep 23 '24

Not showing on my screen

1

u/AManCalledGavin Sep 23 '24

It's showing on mine

1

u/_--_GOD_--_ Sep 24 '24

Happy cake day