Selecting first letter of a string then the first 2 consonants to give a 3 letter string

Hello,

Would anybody know if this is possible? I am sure it is via regex but not entirely sure how to achieve this. I have managed to get the first letter but can’t figure how to programatically pull the first 2 consonants after the first letter

$consonant = "B","C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "X", "Z" $name = "test.com" $name[0] 

submitted by /u/Kieron25
[link] [comments]

Leave a Reply