I think she's trying to use the question mark to make the entire group (within the parens) optional.
@Terisa: While your regex should match (it does for me when I use it in other applications), the question mark (as well the space inside the group) is probably not necessary. The * is already 0 or more repetitions, which implies that what precedes it is "optional."
When you say "goes wrong," do you mean you
want your expression to match the code example you gave, or you
don't want it to match?
Something like:
Should be sufficient to match any p tag that immediately follows a div tag-- regardless if the p tag has any attributes or not.
If you're looking for something else, you'll need to clarify.