Hello, everyone.
Is it possible to use a RegEx plus a string plus RegEx to .split() on a string?
Basically put, I'm trying to code a function that will remove a specific user+userID (and other info) from an element .html() value. There is a <div></div> before the name (CSS gives it a "delete" icon) and a <br> after the name (except for the last name in the list - which is causing me the problem.)
Is it possible to take an argument in a function (like the UUID) and pass it as a literal in the middle of a RegEx mask for the .split()?
The .html() value will be something like:
Code:
<div onclick="removeUser'(\'A1234\',\'John Doe\');" class="deleteIcon"></div>John Doe<br>
<div onclick="removeUser'(\'B2345\',\'Zaphod Beeblebrox\');" class="deleteIcon"></div>Zaphod Beeblebrox<br>
<div onclick="removeUser'(\'B3456\',\'Dr. Who\');" class="deleteIcon"></div>Dr. Who<br>
<div onclick="removeUser'(\'C4567\',\'Smithwicks\');" class="deleteIcon"></div>Smithwicks
I figure that if I can split on the
<div {data}></div>{user name}(possible<br>) and then join on "", that would make it a simple process.
Right now, I'm splitting on just the name, then trying to clean up all
<div></div>(possible <br>) (no name) and it's breaking.