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 7821797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:45:21+00:00 2026-06-02T07:45:21+00:00

I want to replace this titles: Page 1 – example.com Page 2 – example.com

  • 0

I want to replace this titles:

Page 1 - example.com
Page 2 - example.com
Search engine optimization - example.com

I don’t want to replace this titles:

Page 1
Page 2
Search engine optimization

So only if the contain example.com then I want to replace it. I’ve tried something like this:

$document = preg_replace('#(<title[^>]*>)(.*)[(example.com)][^<]+</title>#i', '$1Welcome to my site</title>', $document);

But that is not working. Somebody has an answer?

Thanks in advance.

  • 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-02T07:45:22+00:00Added an answer on June 2, 2026 at 7:45 am
    $document = preg_replace("/(<title>)(.*?) - example.com(<\/title>)/", "$1$2$3", $document)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a link like this: <a href=http://example.com>text</a> and replace the behavior
i want the best regular expression to replace this code <a href=http:// www.badoobook.com/clips/index.php?page=videos&section=view&vid_id=100162> www.badoobook.com/clips/inde......&vid_id=100162
This page shows many recent posts, instead I want it to show only the
I am using only slug to identify a page on the website, like: example.tld/view/this-fancy-slug
I have this string: var someString = 23/03/2012; and want to replace all the
I am doing something like this- http://www.w3schools.com/html5/tryit.asp?filename=tryhtml5_video_js_prop but I want to replace the buttons
I want to be able to replace style=&quot;STUFF&quot; I keep thinking that this is
I have page titles like this: $pageTitle = <title>site - {$cat} - {$q} -
<html> <head><title>Example page</title></head> <body> <textarea name=description>This is some text</textarea> <input type='text' name='bla' value='a textinput'
I want to use jQuery to redirect a person arriving at this page to

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.