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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:57:08+00:00 2026-06-01T05:57:08+00:00

What could be the regular expression to detect a multi byte string. For example

  • 0

What could be the regular expression to detect a multi byte string.

For example here is the expression to detect a string in english

Pattern p=Pattern.compile("[a-zA-Z/]");

Similarly I want a pattern which has multi bytes like

コメント_1050_固-減価償却費

  • 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-01T05:57:09+00:00Added an answer on June 1, 2026 at 5:57 am

    You may want to have a look at Unicode Support in Java

    I think basically you want the Unicode property \p{L}. This would match any code point that has the property “letter”.

    So your regex could look like this

    Pattern p=Pattern.compile("[\\p{L}/]");
    

    I just replaced the character ranges a-zA-Z with \p{L}


    Since Java 7 you could also use Pattern.UNICODE_CHARACTER_CLASS

    Enables the Unicode version of Predefined character classes and POSIX character classes.

    That would turn the predefined \w into the Unicode version, means it would match all Unicode letters and digits (and string connecting characters like _)

    So to match your string コメント_1050_固-減価償却費, you could use

    Pattern p=Pattern.compile("^\\w+$", Pattern.UNICODE_CHARACTER_CLASS);
    

    This would match any string consisting of letters, digits and _

    See here for more details

    and here on regular-expression.info an overview over the Unicode scripts, properties and blocks.

    See here a famous answer from tchrist about the caveats of regex in Java, including an updated what has changed with Java 7 (or will be in Java 8)

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

Sidebar

Related Questions

If I want to analyze a string using dozens of regular-expressions, could either the
I want regular expression for 0000.0000-9999.9999 or 0000-9999 or 0000:0000-9999:9999. could it be :
I was wondering If I could get a regular expression which will match a
I'm looking for one regular expression that could match a string for three specific
Could someone lead me on finding a regular expression that blocks a comma separated
Is it possible to use a regular expression to detect anything that is NOT
I need a regular expression that detects timer strings that could be less than
What regular expression using java could be used to filter out dashes '-' and
Could anybody provide me the regular expression for the following patterns? $1234 $31234.3 $1234.56
Could anybody help me make a proper regular expression from a bunch of text

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.