Reputation: 1097
ticket number: 6666
ticket number : 6666
ticket #6666
ticket # 6666
i tried this one ticket[ \t]+(number|#)?[: \t]+([0-9]+)
but it does not work for "ticket #6666"
Could anybody help?
Upvotes: 0
Views: 110
Reputation: 1323
Try something like this: ticket[\s\t]+(number|#)[:\s\t]*([0-9]+)
Also, if you don't already use it I would recommend http://regexpal.com/ to help you with your testing. It is a great resource to quickly see what is being matched by your expression.
Upvotes: 0
Reputation: 61449
Close; you want the colon/space to be optional.
ticket[ \t]+(number|#)?[: \t]*([0-9]+)
Upvotes: 4