Or is there any other method using substr?
Sure. You can use index to find the index of the first occurrence of @, and the use substr to extract everything before it.
In reply to Re: RegEx to find the index of the character '@' in an Email address
by moritz
in thread RegEx to find the index of the character '@' in an Email address
by itsmetom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |