On Tue, Feb 11, 2025, 7:13 AM Phi Debian <phi.deb...@gmail.com> wrote:
> > > On Mon, Feb 10, 2025 at 11:46 PM microsuxx <fxmb...@gmail.com> wrote: > >> a bit unrelated .. cheap numbers filter .. >> >> gimme_num( ) { declare -n b=BASH_REMATCH\[1] ; local o m=[0-9,.] s=$n i t >> ; >> t="(-?$m+)" ; unset -v o ; for n ; do unset -v i ; while [[ $n =~ $t ]] ; >> do n=${n/"$b"} i= o+=$b$s ; done ; [[ -v i ]] && o+=$s ; done ; [[ -v o ]] >> && printf %s "$o" ; } >> >> gimme_num ' ab3.44 cd---.99 ' cd cd 77.7.77 >> >> 3.44 >> -.99 >> >> 77.7.77 >> >> > Rejected > $ gimme_num '0x10' > 0x10xx > $ gimme_num '64#yo' > 64xx > $ gimme_num '0x10' > 0#yo10#yo#yo > > gimme_num should be renamed random_string() > how does it output strings .. ? i mean i dont get ur outputs 1 it doesnt include # and @ etc 2 no hex etc yet , only numbers and dots / commas gimme_num 0x10 60#yo 0x10 0 10 60 0 10 but i dont get ur outputs such as 0x10xx or 64xx or the other .. >