I'm looking to grab an ID number from an email subject line and almost have the correct expression, but it it only works when the ID is at the start of the line.
The regex needs to match:
- Numbers only
- 6 characters
- Begins with 4
At the moment I have:
/(^4[0-9]{5})/
Examples Subject Lines:
This works: '406677 - Your reference'
This doesn't: 'Your reference 406677'
What do I need to change to select the ID from any position it may appear in the subject line?
Thanks