|Java/perl provide the following
That represents a 'boundary' however you should read up on that to insure that is what you really want.
Might also keep in mind that Java/Perl are aggressive in that they look for the best match not the first match. That means that it will keep trying until it is sure. That can result in a lot of processing - sometimes leading to days or even infinite searches. Although your current formats should not do that.
Anchoring to anything will optimize the search.