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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

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.