Question: I have an Android application that is brand-able. We were using SDK v15 (4.0.x) and when building the application through ant, we would specify package.name=com.blah.brand in the ant properties script. This would allow us to install the same application multiple times on the device but each would be it's own application and settings.

Since upgrading to SDK v16 (4.1), this no longer works and I am unable to find a way to change the packing name when building the application. Does anyone know the new way on how to do this?

Answer: 
sed (and other utilities which use Posix Basic Regular Expressions) don't give any special meaning to `(` and `)` so you can just use them like any other character. `\(` and `\)` are the group delimiters.

BRE's really should die. Long, long ago, Posix defined "Extended" Regular Expressions (EREs) in which the grouping delimiters are `(` and `)` and you use `\(` and `\)` to match parentheses, which is a lot more intuitive. There is a similar difference between BRE and ERE treatment of `{` and `}` (numerical repetition operators). EREs also include the `|` and `+` operators.

`grep` and `sed` both default to using BREs, but can be persuaded to use EREs with the correct command-line flag: `grep -E` and `sed -r`. gawk uses EREs with some GNU extensions and some deviations from the standard, including the fact that you must specify --re-interval if you want to use `{` and `}`. [rant]It sometimes amazes me that we tolerate all this insanity. There should be just one regex standard, and all utilities should use it without exceptions.[/rant]

If your regex with `(` and `)` is not working as you expect, please provide specific examples of patterns which it fails on, and your expected outcome. My suspicion is that it has to do with the space characters in your pattern, if that is actually the pattern you're using.
I think your problem is a greedy match that first .\* pattern takes. 

try to replace it with [^()]\* to exclude parenthes:

```
bash$ echo 'xxx(123)yyy' | sed -e 's/[^()]*(\([[:alnum:]]*\))[^()]*/\1/' ->
123

```