(regex)
regular expression literals
clojure
(regex pattern? flags?)Where:
- pattern: the regex pattern (the content between the slashes) *
- flags: the regex flags (e.g., g, i, m) *
Examples
Find global regex patterns that may need the 'u' flag for Unicode support.
clojure
(regex _ g)Selects in lines { 1 } but not in { 2, 1 }:
typescript
const pattern = /\w+/g
const unicodeSafe = /\w+/gu
const simple = /\w+/Locate case-insensitive email validation regexes for security audit.
clojure
(regex /email|@/ i)Selects in lines { 1 } but not in { 2, 3 }:
typescript
const emailRegex = /[\w.]+@[\w.]+/i
const urlRegex = /https?:\/\//i
const strictEmail = /^[\w.]+@[\w.]+$/Find regexes matching specific patterns to replace with named groups.
clojure
(regex /\(\?:/)Selects in lines { 1 } but not in { 2, 3 }:
typescript
const nonCapturing = /(?:foo|bar)/
const capturing = /(foo|bar)/
const named = /(?<word>foo|bar)/Arguments
pattern
• String • Pattern • Identifier
Does NOT support: Composition — Free-form Selection — Refinement — Replacement
flags
• Identifier • String • Pattern
Does NOT support: Composition — Free-form Selection — Refinement — Replacement