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.:
- idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)(/w{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")
- idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)([a-zA-Z0-9]{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")
- idEquityTemp=$(echo "$FILENAME" | sed -E "s/(dataEquity-)([[:digit:]]{1,12})(( \([0,9]{1,3}\))|())(\.json)/\2/g")
Windows Version
WSL Ubuntu: Version 2.
I am looking forward to your response.
Thanks,
Anneliese