I want to validate a string which should follow a specific defined pattern.
Rule are
- it should starts with any of this three words 'Dev', 'Tweak' or 'Feature'
- then should have a space hyphen and space i.e.,
- - and three or word followed by a period. (also it can have URL or '#' or punctuators)
So I have written a regex like this, but some how it is not working
^((Tweak|Dev|Feature)(\s-\s)(\w{3,})(\.))$
Here is the regex playground URL: https://regex101.com/r/136LCG/1
The regex should match following strings
- Tweak - this should be correct.
- Feature - my feature having a special character as #123.
- Dev - this should also work https://regex101.com/
- Dev - this is my message. Ref projectname#123.
- Dev - my message having long sentence, with additional punctuators.
