Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7715025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:16:57+00:00 2026-06-01T02:16:57+00:00

I have following syntax in my script to get email address from string. The

  • 0

I have following syntax in my script to get email address from string. The email address contains – . 1234567890 _ characters. The email address is retrieved but not _ character before @ sign.

preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>', $value);

For example: The email address in string is ahmad_khalid@yahoo.com , with above syntax it returns khalid@yahoo.com

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:16:59+00:00Added an answer on June 1, 2026 at 2:16 am

    You’d need to add in the _ character to your regex, so it would become

    preg_replace("/<([a-z][_a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>', $value);
    

    Alternately, you can do

    preg_replace("/<([a-z][\w]*)[^>]*?(\/?)>/i",'<$1$2>', $value);
    

    Using the “word character” \w as shorthand

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on my first login script. I have been following examples from
I have the following regular expression validator to detect whether an input string contains
I have the following shell script : #!/bin/sh output=`./process_test.sh status_pid | grep NOT STARTED:
I have the following script: #!/bin/sh r=3 r=$((r+5)) echo r However, I get this
I have an MS SQL function that is called with the following syntax: SELECT
I have the following in my .vimrc syntax on filetype plugin indent on #
I have the following code (changed object names, so syntax/spelling errors ignore). public class
I need syntax help with the following code logic: I have a code block
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.