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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:11:59+00:00 2026-05-29T07:11:59+00:00

I have a web site module which collects some tweets from twitter and splits

  • 0

I have a web site module which collects some tweets from twitter and splits them as words to put into a database. However, as the tweets usually have Turkish characters [ıöüğşçİÖÜĞŞÇ], my module cannot divide the words correctly.

For example, the phrase Aynı labda çalıştığım is split into Ayn, labda and alıştığım, but it should have been split into Aynı, labda and çalıştığım

Here’s my code which does the job:

preg_match_all('/(\A|\b)[A-Z\Ç\Ö\Ş\İ\Ğ\Ü]?[a-z\ç\ö\ş\ı\ğ\ü]+(\Z|\b)/u', $text,$a);

What do you think is wrong here?

Important Note: I’m not stupid not to split text by the space character, I need exactly these characters to match. I don’t want any numerical or special character such as [,.!@#$^&*123456780].

I need a regular expression that will split this
kısa isimleri ile “Vic” ve “Wick” vardı.

into this:

kısa
isimleri
ile
Vic
ve
Wick
vardı

More examples:

We’re @test would be

We
re
test

Föö bär, we’re @test to0 ÅÄÖ – 123 ok? kthxbai? is split into this,

b
r
we
re
test
ok
kthxbai

but I want it to be:

Föö
bär
we
re
test
ÅÄÖ
ok
kthxbai
  • 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-29T07:11:59+00:00Added an answer on May 29, 2026 at 7:11 am

    This expression would give you the desired result (according to your examples):

    /(?<!\pL|\pN)\pL+(?!\pL|\pN)/u
    

    \pL matches any unicode letter. The lookarounds are needed to make sure it isn’t followed or preceded by numbers, to completely exclude words containing any numbers.

    Example:

    $str = "Aynı, labda - çalıştığım? \"quote\". Föö bär, we're @test to0 ÅÄÖ - 123 ok? kthxbai?";
    preg_match_all('/(?<!\pL|\pN)\pL+(?!\pL|\pN)/u', $str, $m);
    print_r($m);
    

    Output:

    Array
    (
        [0] => Array
            (
                [0] => Aynı
                [1] => labda
                [2] => çalıştığım
                [3] => quote
                [4] => Föö
                [5] => bär
                [6] => we
                [7] => re
                [8] => test
                [9] => ÅÄÖ
                [10] => ok
                [11] => kthxbai
            )
    
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web site which I download 2-3 MB of raw data from
Here's the setup. I have web site which is essentially a simple CMS. Here
I am building one web site. I build some modules which hold menu, logo,
I have a ASP.Net MVC 2 web site, which can be visited by http://localhost/Admin/ContentMgr/
I have a web site in asp.net that uses a master page. In this
I have a web site using apache httpd as the server and mysql as
I have a web site running via IIS7 on Vista. The site is running
I have a web site that is a customer to customer (C2C) service. Example,
I have a web site that I administer that uses Apache 2.0 on the
I have a web site hosted on IIS with windows authentication. I am trying

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.