Skip to content

"." is interpreted as regex #25

@roland-KA

Description

@roland-KA

I would like to remove an occurence of a dot inside a string. Therefore I used the following expression:

str_remove("345.67", ".")

The result is not "34567" as expected, but "45.67". str_remove seems to interpret "." as a regular expression, even if there is no r-prefix (like in r".").

So I have to do

str_remove("345.67", "\\.")

to get the intended behaviour.

Shouldn't "." be interpreted just as a string as it has no r-prefix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions