how to grab username wiith RE ?
For example:
User: john_smith
User john_smith
User john_smith
I need to grab john_smith
i tried this [ \t]+(User)?[: \t]*([.]+)
but can’t get it working.
Can anybody help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try without the leading
[ \t]+, which means ‘at least one’. Or use[ \t]*which means ‘as much as you want, maybe zero’.The word ‘User’ doesn’t look optional, so continue with
User[: \t]*. The dot is a Joker and matches every Character.Therefore it doesn’t make sense to include it into a group. The rest of the group gets meaningless, and it adds nothing to the dot. Therefore a dot in a group means a literal dot. Use just the dot instead:
(.+)