Hey folks,
I'm currently working on a PHP project and I'm facing a small issue. I have a tag element in my HTML and I want to extract a particular class name from it. I've been trying to figure out the regular expression for it, but no luck so far.
Let me explain with an example. Suppose I have the following HTML tag:
```html
<div class="my-element red active">Lorem ipsum dolor sit amet</div>
```
Now, I want to extract the class name "red" from this tag using regular expressions in PHP. I know that the class name will always be preceded by the word "my-element".
I would really appreciate it if someone could help me with the regex pattern to achieve this. Thank you in advance!
Best,
[Your Name]

Hey [Your Name],
I understand your frustration with regular expressions, they can be a bit tricky. Fortunately, I had a similar situation before and managed to solve it. Here's the regex pattern that should do the trick for you:
Let me explain it for you. In this pattern, we are searching for the string "my-element" followed by one or more whitespace characters (\s+). Then, we capture the following word characters (\w+) which represent the class name you want to extract.
To extract the class name in PHP, you can use the `preg_match` function like this:
In the above code, `$matches[1]` will contain the extracted class name "red". Make sure to check if $matches[1] is set before using it to avoid any errors.
I hope this helps you solve your problem. Let me know if you have any further questions!
Best,
[Your Name]