could be something like

```ruby
return tru if value.to_s =~ /^0x[0-9]+$/ or value.to_s =~ /^0[0-9]+$/
```