Skip to content

Probably there is a mistake in split-words fn #23

@galatyn

Description

@galatyn

Steps to reproduce

(str/lisp-case "message(SMS)")
=> "message(sm-s)"

Actual result: "message(sm-s)"
Expected result: "message(sms)"

How to fix

The problem seems to be here:

(replace #"(\p{javaUpperCase})((\p{javaUpperCase})[(\p{javaLowerCase})0-9])" "$1 $2")

Because this RE [(\p{javaLowerCase})0-9] will catch digits, lower cased chars and, I believe unwanted, parentheses ( ).
This probably should be
[\p{javaLowerCase}0-9] instead of
[(\p{javaLowerCase})0-9]
Example:

(clojure.string/replace "aB()" #"[\p{javaLowerCase}]" "-")
=> "-B()"
(clojure.string/replace "aB()" #"[(\p{javaLowerCase})]" "-")
=> "-B--"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions