jasonc Posted June 15, 2017 Share Posted June 15, 2017 I wish to highlight the special characters that fall within the following range x00 to x7FPlease can someone advise how could I do this ? Quote Link to comment https://forums.phpfreaks.com/topic/304135-search-and-replace-wrapped-in-span-characters-within-a-range/ Share on other sites More sharing options...
Jacques1 Posted June 15, 2017 Share Posted June 15, 2017 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. Quote Link to comment https://forums.phpfreaks.com/topic/304135-search-and-replace-wrapped-in-span-characters-within-a-range/#findComment-1547376 Share on other sites More sharing options...
jasonc Posted June 15, 2017 Author Share Posted June 15, 2017 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. Quote Link to comment https://forums.phpfreaks.com/topic/304135-search-and-replace-wrapped-in-span-characters-within-a-range/#findComment-1547377 Share on other sites More sharing options...
jasonc Posted June 15, 2017 Author Share Posted June 15, 2017 (edited) can this be done using preg_replace? Edited June 15, 2017 by jasonc Quote Link to comment https://forums.phpfreaks.com/topic/304135-search-and-replace-wrapped-in-span-characters-within-a-range/#findComment-1547378 Share on other sites More sharing options...
Jacques1 Posted June 15, 2017 Share Posted June 15, 2017 You haven't answered the questions. What is the purpose of this exercise? 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. What is the input encoding? Quote Link to comment https://forums.phpfreaks.com/topic/304135-search-and-replace-wrapped-in-span-characters-within-a-range/#findComment-1547379 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.