Jump to content
jasonc

Search and replace wrapped in span characters within a range

Recommended Posts

I wish to highlight the special characters that fall within the following range x00 to x7F

Please can someone advise how could I do this ?

Share this post


Link to post
Share on other sites

You couldn't be more cryptic.

 

First off: What on earth are you trying to achieve? I don't mean “I want a regex” but the overall goal.

 

Your input is what? ASCII? And with “range x00 to x7F” you mean the control characters? What about them?

 

Look, we're no mind readers. In your head, this may all make sense, but on the outside, it really doesn't.

Share this post


Link to post
Share on other sites

I wish to read all data from a DB table and display it. Displaying each record, if there is a character is between x0 and x7F then wrap it in a span that will highlight it using CSS.

Share this post


Link to post
Share on other sites

can this be done using preg_replace? 

Edited by jasonc

Share this post


Link to post
Share on other sites

You haven't answered the questions.

  1. What is the purpose of this exercise?
  2. The control characters are by definition unprintable. How do you “highlight” something which has no graphical representation? Except for newlines and tabs, there's literally nothing on the screen.
  3. What is the input encoding?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.