Skip to content

(str*)

string-like binary expressions matched by their pseudo-evaluated value (e.g., 'foo' + bar)

clojure
(str* val)

Where:

  1. val: the string pattern to find *

Matching:

  1. binary concatenation, e.g. "foo" + bar
  2. chained concatenation, e.g. "foo" + bar + "baz"

Behavior

  • Pseudo-evaluates binary expressions by concatenating literal fragments and identifier names in order; operators are ignored.
  • Only matches binary expressions; use (str ...) for plain string literals.

Examples

Find cache keys built from userId to standardize naming.

clojure
(str* /userId/)

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

typescript
const key1 = "cache:" + userId
const key2 = "cache:" + accountId
const key3 = prefix + userId

Locate error translation keys assembled from the errors. prefix.

clojure
(str* "errors.timeout")

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

typescript
const key1 = "errors." + timeout
const key2 = "errors." + code
const key3 = "warnings." + timeout

Find report export paths built by concatenation.

clojure
(str* /reports/)

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

typescript
const path1 = "reports/" + reportId
const path2 = "reports/" + month
const path3 = "exports/" + reportId

Arguments

val

• Identifier • String • Pattern

Does NOT support: CompositionFree-form SelectionRefinementReplacement

Copyright © 2022-present Semantic Works, Inc.