I have the following question, a file with pattern like this:

```
1XYZ00

```

so the result would be

```
2XYZ00

```

I want to change only the first number with another number, for example 9 and not changing anything for the rest of the patern.

I really need to capture this pattern **1XYZ00** and only this one and replace the first number with another one.
I this file I can have numbers but with different pattern and those must not be modified.

The OS is CentOS 7.

Here is what I have tested

```
sed -E 's/1{1}[A-Z]{3}[0-9]{2}/9{1}[A-Z]{3}[0-9]{2}/g' ~/input.txt > ~/output.txt

```

I also tried with capture group:

```
sed --debug -E -r 's/1\(1{1}[A-Z]{3}[0-9]{2}\)/9\1/g' ~/input.txt > ~/output.txt

```

The sed's debug mode tells me that the pattern matches but no replacement is made.

I think I am pretty close, does any expert could help me please ?

Thanks a lot,