I return the following string from a webpage
Order Number: 1509596 Customer Number: 8
but it could also be
Order ID 1509596 Customer 8
I want to use regex so in my method I just return the order number, I was doing
orderNumber.replaceAll("[^0-9]", "")
but that obviously doesn't work because I then have an 8 on the end of my order number. Can somebody help me how I would just the order number as I'm rubbish at reg ex!
The string will always be 50 characters long but the order number is dynamic so I don't know how long it will be, is it possible to just return the first number in the string?
Customer.+|[^0-9]