I'm looking to convert a string of ASCII characters (ie: a) to the html entities specifying ASCII codes they represent (ie: a;).
But this time instead of converting the entire HTML document it should just target the ASCII Characters Ignore the safe encoding characters (&, linebreaks, <, >, " and ') and html keywords like (class, div, h1, span etc)
So this should translate to something like
<div class="login-area-wrapper">
<div class="login-area">
<h1>Click here to Login</h1>
<span class="create-account-link" id="createAccountSpan">
No Account?
<a href="https://www.sample.com/signup/" id="createAccount">Sign up</a>
THIS:
<div class="login-area-wrapper">
<div class="login-area">
<h1>Click here to Login</h1>
<span class="create-account-link" id="createAccountSpan">
No Account?
<a href="https://www.sample.com/signup/" id="createAccount">Sign up</a>
I Hope my explanation isn't that miserable...
Looks pretty crazy to me. :) First I'd write a regex for it, try https://regexr.com/ type in your code and find the right expression that matches what you're looking for. For instance: "([^"]*)"
this would find everything in the quotes, but you probably need to add a regex tag to your question to get someone more qualified to figure it out exactly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.