Skip to content

rb/str

string literals

clojure
(str val?)

Where:

  1. val: string value to match *

Behavior

  • Matches string literals regardless of quote style.

Examples

Find hardcoded API endpoints before moving them to configuration.

clojure
(str /https?:\/\//)

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

ruby
API_URL = "https://api.example.com"
LOCAL_URL = "http://localhost:3000"
PATH = "/users"

Locate debug output before cleanup.

clojure
(call (id puts) (arg 1 (str /^DEBUG:/)))

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

ruby
puts "DEBUG: ready"
puts "INFO: started"
logger.debug("DEBUG: not puts")

Find exception messages that mention deprecation.

clojure
(str /deprecated/i)

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

ruby
raise "Deprecated API"
warn "deprecated: use new_api"

Arguments

val

• Identifier • String • Pattern

Does NOT support: CompositionFree-form SelectionRefinementReplacement

Copyright © 2022-present Semantic Works, Inc.