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

  • Home
  • SEARCH
  • 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 7928353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:42:28+00:00 2026-06-03T19:42:28+00:00

Is there a means to return the pattern found from within an input variable,

  • 0

Is there a means to return the pattern found from within an input variable, with the possible addition of highlighting the pattern within the variable? (e.g. for Regex, returning the input variable with the pattern found)

  • 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-03T19:42:30+00:00Added an answer on June 3, 2026 at 7:42 pm

    While your question is a bit unclear, it sounds like you would like to merely highlight or mark in some form or fashion a substring (or perhaps a pattern) of a larger string. There are many ways to go about this, depending especially on the substring/pattern you’d like to search, but here’s a simple example:

    $input = "There is a pattern in this string. Mark the pattern.";
    
    // There is a <em>pattern</em> in this string. Mark the <em>pattern</em>
    echo preg_replace( "/(pattern)/", "<em>$1</em>", $input );
    

    Of course this merely replaces the pattern with a modified version, returning the full string. Other functions, like preg_match or preg_match_all can return an array of the matched patterns. Again, it all depends on what your precise needs are.

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

Sidebar

Related Questions

Is there a way to have a public function from the module-pattern accessing private
Is there are means whereby if files are altered outside of Xcode, that a
This program I'm doing is about a social network, which means there are users
So what started as A problem with buttons, just means there is A problem
Is there any difference(means full/limited access) in iphone SDK before and after enrolling in
I'm wondering if there is a standard or normal means of interpreting time interval
Is there a way to make the UIPickerView read-only? This means that the user
I notice that there is getWebApplicationContext in org.springframework.web.servlet.mvc.AbstractController . This means that spring programmers
I found following in javascript code function calculateURI(uri) { return (namespace.push.configuration.uriPrefix || '') +
From the text The Repository pattern is a Mediator between the Domain and Data

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.