Skip to content

Instantly share code, notes, and snippets.

@naxmefy
Created April 22, 2021 22:19
Show Gist options
  • Save naxmefy/37e29c84b15804ba95c47828375eeb0c to your computer and use it in GitHub Desktop.
Save naxmefy/37e29c84b15804ba95c47828375eeb0c to your computer and use it in GitHub Desktop.
sum all numerics in a sentence (string with spaces)
print(readline().match(/\d+/g).reduce((p,c)=>p+(+c),0))
p eval`dd`.scan(/\d+/)*?+
egrep -o [0-9]+|paste -sd+|bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment