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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:12:14+00:00 2026-05-27T21:12:14+00:00

I was using a REGEX pattern in java (given below): for the string: It

  • 0

I was using a REGEX pattern in java (given below):
Working Pattern

for the string:
working string
It works fine. But when I tried using the below pattern:
non working pattern

for the string:str =

nonworking string
Sorry about the image upload. Looks like the character ‘[]’ in a00[] is encoded differently on the browser. Any ways to read that character in a different manner? The same character has a different representation in notepad++. I’m using RXTX and inputStream.read(readBuffer) to read the data. Is there any way I can update my encoding methods in java to overcome this?
https://i.stack.imgur.com/FydBg.jpg
i.imgur.com

P.S: Sorry about the image description – if it type it out i cant represent that character.
when i copy paste that character, it becomes an empty space.

  • 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-27T21:12:15+00:00Added an answer on May 27, 2026 at 9:12 pm

    The strange symbol (└) looks like how ASCII 3 is represented in some fonts.

    In Regex, \b matches a word boundary. That is, between an alphanumeric and non-alphanumeric character. It works in the first case because there is a digit (“9”) before the matched substring, and an exclamation mark (“!”) right after it (which is a non-alphanumeric character).

    In the second case you changed the exclamation mark to a letter, so there is no longer a transition from alphanumeric to non-alphanumeric.

    The solution is to extend the Regex so it also matches the symbol and digit:

    Pattern.compile("(\\x03\\d)(a)\\w*(?=\\x03\\d)");
    

    I used \\x03\\d to match the codes. The last part (?= ) is a look-ahead. It checks if it matches, but does not consume it. This is so, so you do multiple matches in a row.


    A simpler alternative, would be to just split the string on “└”, and examine the pieces.

    s.split("\u0003")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried writing a program in Java using regex to match a pattern and
Using java.util.regex.Pattern.compile() you can specify a pattern as parameter. But how can you specify
Using Java regex pattern I want to match the & symbol. But it should
I am using java regex package to validate an email as below: Pattern p
I am using the matches string builtin and need to run a regex pattern
I'm using java.util.regex.Pattern to match passwords that meet the following criteria: At least 7
I tried this regex in Java : Pattern orderCheck = Pattern.compile("^([\\-\\+])?(created|title|price|creation)$", Pattern.CASE_INSENSITIVE); orderCheck.matcher(value).matches(); And
I want to using regex on Java to split a number string. I using
I'm implementing a keyword highlighter in Java. I'm using java.util.regex.Pattern to highlight (making bold)
What regex pattern would need I to pass to java.lang.String.split() to split a String

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.