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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:28:43+00:00 2026-05-26T01:28:43+00:00

I have a set of characters like . , ! , ? , ;

  • 0

I have a set of characters like

., !, ?, ;, (space)

and a string, which may or may not be UTF 8 (any language).

Is there a easy way to find out if the string has one of the character set above?

For example:

这是一个在中国的字符串。

which translates to

This is a string in chinese.

The dot character looks different in the first string. Is that a totally different character, or the dot correspondent in utf 8?

Or maybe there’s a list somewhere with Unicode punctuation character codes?

  • 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-26T01:28:44+00:00Added an answer on May 26, 2026 at 1:28 am

    In Unicode there are character propertiesPHP Docs, for example Symbols, Letters and the like. You can search for any string of a specific class with preg_matchDocs and the u modifier.

    echo preg_match('/pP$/u', $str);
    

    However, your string needs to be UTF-8 to do that.

    You can test this on your own, I created a little script that tests for all properties via preg_match:

    Looking for properties of last character in "Test.":
    Found Punctuation (P).
    Found Other punctuation (Po).
    
    Looking for properties of last character in "这是一个在中国的字符串。":
    Found Punctuation (P).
    Found Other punctuation (Po).
    

    Related: PHP – Fast way to strip all characters not displayable in browser from utf8 string.

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

Sidebar

Related Questions

I have an NSString which is splitted into set of characters. I need to
I have a large set of files, some of which contain special characters in
Is there any way to de/serialize an object without round-tripping a XmlDocument/temp string? I
I have a set of strings which looks like 4 7 14 0 2
I have a long text string (including \n newline characters) that I feed into
I have a combo box where I am displaying some entries like: Equals Not
I have a table which is full of arbitrarily formatted phone numbers, like this
You often see database fields set to have a magnitude of 255 characters, what
So I have a set of timestamps like this: datetime<-c(2011-09-28 03:33:00, 2011-08-24 13:41:00, 2011-09-19
I have a set of 6 bits that represent a 7bit ASCII character. How

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.