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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:15:43+00:00 2026-05-17T02:15:43+00:00

I have a function in Java which I need to convert into php. It

  • 0

I have a function in Java which I need to convert into php. It converts unicode text into characters. For example input is

“Every person haveue280 sumue340 ambition”;

I want to replace ue280, ue340 to \ue280, \ue340 with regular expression

Here is code written in Java

String in = "Every person haveue280 sumue340 ambition";
Pattern p = Pattern.compile("u(\\p{XDigit}{4})");  
Matcher m = p.matcher(in);  
StringBuffer buf = new StringBuffer();  
while(m.find())   
    m.appendReplacement(buf, "" + (char) Integer.parseInt(m.group(1), 16));  
m.appendTail(buf);  
String out = buf.toString();

Is it possible to convert it into php

Thanks in advance

  • 1 1 Answer
  • 1 View
  • 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-17T02:15:44+00:00Added an answer on May 17, 2026 at 2:15 am

    In PHP, use preg_replace() for regex functionality.

    I don’t think PHP’s preg_* functions support the wordy {XDigit} notation, so you’ll need to use a character class like [0-9A-Fa-f] for hex digits.

    If you know regex well enough to understand the code you already have then that should be enough to get you started.

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

Sidebar

Related Questions

I need to convert a Word document into HTML file(s) in Java. The function
I have a function written in Java which accepts varargs as an argument. I
I have Java application which sends pointer to function (callback) to some native dll
I have a java code which gets the function names, their return types, their
I have a large non static JAVA function, which uses this reference at several
I have an assignment in which I need to create a function that tells
I have a Java Applet which is digitally signed. I need to be able
I need to implement callback function in Java using interface. I have wrote the
I have a third party java program called kgsgtp.jar which need to communicate with
I have a number of collections of classes which I need to refactor into

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.