I have created a singup button as follows:

```
signupButton = [[UIButton alloc] initWithFrame:CGRectMake(10,(facebookLoginButton.bounds.size.height + 40),300,50)];
signupButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
UIImage *signupButtonImage = [[UIImage imageNamed:@"Signup"]
                              resizableImageWithCapInsets:UIEdgeInsetsMake(0, 10, 0, 10)];
[signupButton setBackgroundImage:signupButtonImage forState:UIControlStateNormal];

```

The frame for the button is 300x50 per the above. I have created an image (for Retina devices) as 22(w)x100(h)px.

The image is 22 pixels which includes 10px rounded corners and 2px which are for the repeatable middle section.

I have tried to implement the stretch per the above code with insets as 0,10,0,10 but this does not stretch as expected.

![enter image description here](https://i.stack.imgur.com/5aiBT.png)

![Actual image](https://i.stack.imgur.com/MiNNJ.png)

Can someone explain what the insets should be? Also how to work these out, I cannot find any useful information on how to actually calculate what the insets should be? I have read the Apple documentation on this, but I do not understand how to work these out.
['https://Stackoverflow.com/questions/15722072', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1523603/']
You don't need the starting and trailing `.*`, but you do need to escape the `$` as it has the special meaning of the zero-width end of the string.

```
\\$_POST\\['[a-zA-Z0-9]*'\\]

```
Use this:

```
"\\$_POST\\['([a-zA-Z0-9]*)'\\]"

```

Symbols like `$`have particular meanings in regex. Therefore, you need to prefix them with `\`