Requirement: 

If pattern **57XXXXXXX** OR **57XXXXXXX-X** found in a sentence , then copy this matched pattern (**X**- denotes 7 integer number and **57** are constant values must be there), else ignore complete sentence.

I have written a regex pattern `57[0-9]{7}|-[0-9]{1}` to do match both the pattern. 

If below pattern found(8 digits after 57 instead 7 , then still above regex still gets the matching pattern (actually expecting regex to not match)

for e.g. 5712345678-0 (after 57 , 8 digits in sentance) --> regex matches and gives 571234567-0 

Using java to compile above pattern.