Issue #21870 has been updated by jneen (Jeanine Adkisson). Another example of this is `/[\p{Word}\p{Cf}]/`, which seem to overlap precisely on ZWNJ (U+200C) and ZWJ (U+200D). ```ruby [1] pry(main)> (0..0x10ffff).select{(s=[it].pack('U'); s=~/\p{Word}/&&s=~/\p{Cf}/) rescue false}.map{it.to_s 16 } => ["200c", "200d"] [2] pry(main)> /[\p{Word}\p{Cf}]/ (pry):5: warning: character class has duplicated range: /[\p{Word}\p{Cf}]/ => /[\p{Word}\p{Cf}]/ [3] pry(main)> ``` ---------------------------------------- Bug #21870: Regexp: Warnings when using slightly overlapping \p{...} classes https://bugs.ruby-lang.org/issues/21870#change-116324 * Author: jneen (Jeanine Adkisson) * Status: Open * ruby -v: 4.0.1 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- ```ruby $VERBOSE = true # warning: character class has duplicated range: /[\p{Word}\p{S}]/ regex = /[\p{Word}\p{S}]/ ``` As far as I can tell this is a perfectly valid ~~and non-overlapping~~ set of unicode properties, but I am still being spammed with warnings. Using `/(\p{Word}|\p{S})/` is kind of a workaround, but it is slower. Edit: They do overlap somewhat, but I think the deeper issue is there is not a convenient way to express this without falling back to raw unicode ranges. -- https://bugs.ruby-lang.org/