Get class containing string and number from multiple classes
jquery, match, regex
Solution
If you are in the jQuery `.click()` handler and need that ID that follows `wp-image-`:
var id = $(this).prop('class').match(/wp-image-([0-9]+)/)[1];
Problem
I have the image below with multiple classes. On click, I need to get the string "wp-image-1228" (those four numbers will always be different) from all of the classes. I've got the click down, but I can't seem to get what I need using .match. ``` <img class="size-post_gal wp-image-1228 aligncenter"> ```