I have been working for a few hours on how to write a regex for a bash script that will only grab a group of more than 2 numbers. For example, if I had #jk2478_0.JPEG, I would only want to return 2478. I can return all of the numbers, but can’t figure how to not include the 0 in the result for this example. Here is what I have so far.
i='#jk2478_0.JPEG';
f=`echo $i | sed s/[^0-9]*[^0-9]//g`
echo $f #24780
-omeans match only