Skip to content

(num)

numeric literals

clojure
(num val?)

Where:

  1. val: numeric value to match *

Behavior

  • Matches integer literals only; floats are not matched.

Examples

Find magic numbers in timeout configurations.

clojure
(num 1000..5000)

Selects in lines { 1, 2 } but not in { 3 }:

ruby
TIMEOUT = 1000
RETRY = 5000
LONG_WAIT = 10000

Locate HTTP status codes in the 4xx range.

clojure
(num 400..499)

Selects in lines { 1 } but not in { 4 }:

ruby
if status == 404
  warn "not found"
end
if status == 500
  warn "error"
end

Arguments

val

• Number • Numeric Range

Does NOT support: CompositionFree-form SelectionRefinementReplacement

Copyright © 2022-present Semantic Works, Inc.