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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:57:00+00:00 2026-05-26T18:57:00+00:00

Is it possible to add a filter with words that IF found, the regex

  • 0

Is it possible to add a “filter” with words that IF found, the regex does not split the words? – Wow i hope my english makes sense 🙂

Let me illustrated..

This is my current regex to split strings such as: TheStringIsSItTING Together

$taglist=preg_replace('/([a-z])([A-Z])/','$1 $2', $taglist);

With the example string the regex produces: The String Is SIt TING

I would like to have a filter, where i could put in SItTING so that the regex does not split that word up.

Please let me know if my explanation was not good enough, i am battling with my english still 🙂

Oh, and thanks for a GREAT community!!

  • 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-05-26T18:57:01+00:00Added an answer on May 26, 2026 at 6:57 pm

    You can’t really check if you’re in the middle of a word without manually breaking apart that word with lookaround assertions as @stema has done. To have a list of exclusions, you’d have to do it a bit more programmatically.

    $taglist = 'TheStringIsNowCurrentlySItTING';
    $excludeList = array(
        'SItTING',
        'StringIs',
    );
    
    $exclusions = implode('|', $excludeList);
    $tagArr = preg_split("/($exclusions)/", $taglist, -1, PREG_SPLIT_DELIM_CAPTURE);
    foreach ($tagArr as &$token) {
        if (!in_array($token, $excludeList)) {
            $token = preg_replace('/([a-z])([A-Z])/', '$1 $2', $token);
        }
    }
    $taglist = implode(' ', $tagArr);
    
    1. Break it apart on your excluded terms.
    2. Put spaces only in the terms that aren’t excluded.
    3. Glue everything back together with spaces.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to add an image overlay to a google map that scales
Is it possible to add a jQuery function so that a click in a
For IE7, it's possible to add filter: none; to the body css to disable
In Fluent NHibernate, is it possible to add a parameter to a filter of
I dont know if what i am asking is possible or not. That is
Is it possible to add a sort-of a global filter to an Entity Framework
Is it possible to add a custom tab to a project properties page in
Is it possible to add attributes at runtime or to change the value of
Is it possible to add custom command-line arguments to an Eclipse .app folder? In
Is it possible to add a metadata-like description or comments to a table in

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.