Hi,
I have the following installation: windows11 + wsl ubuntu + sed 4.8 

The test-sting is as follows: dataEquity-11521 (128).json

This works, however is not really correct, as I only want to have digits at this place
  • idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)(.{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")

These do not work. The result is alway the whole string.:

  1. idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)(/w{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")
  2. idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)([a-zA-Z0-9]{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")
  3. idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)([[:digit:]]{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")

Windows Version
Inline-Bild

WSL Ubuntu: Version 2.

I reinstalled sed but that didn't help
man sed: Only shows a short version of the manual not this one, so perhaps not the correct sed is installed: https://www.gnu.org/software/sed/manual/sed.html#Introduction


I am looking forward to your response.
Thanks,
Anneliese