I need to split an email address and take out the first character and the first character after the '@'
I can do this as follows:
'bar@foo'.split('@').map(function(a){ return a.charAt(0); }).join('')
--> bf
Now I was wondering if it can be done using a regex match, something like this
'bar@foo'.match(/^(\w).*?@(\w)/).join('')
--> bar@fbf
Not really what I want, but I'm sure I miss something here! Any suggestions ?