Write one string that must match and one that must not. Start with the smallest literal pattern that distinguishes them in the regex tester, then add anchors, classes, groups, or quantifiers one at a time. Re-run both examples after every change.
Test empty input, punctuation, newlines, Unicode, and long strings where relevant. Watch for greediness and unintended partial matches; ^ and $ may be needed if the whole input must match. Check the regex flavor used by your actual application because escaping and supported features vary.
If the expression becomes hard to explain, consider simpler parsing code or several named checks instead of one giant pattern.