I've been reading through regex and I thought this would work but it doesn't seem to want to work. All I need to do is strip the leading 1 off a phone number if it exists.

So:

def mphone = 1+555-555-5555
mphone.replace(/^1/, "")

Shouldn't this output +555-555-5555?

Edit
Report