Skip to content

Indexes Offset By Non-word Characters #14

@HeyITGuyFixIt

Description

@HeyITGuyFixIt

I noticed that when I check a string, and it returns a match, when I look at the indexes, the indexes don't match the original string. It actually looks like it is the indexes of the string without any whitespace (or at least any spaces).

For example, say I have this string, hello world censor hello world, and I am trying to match the word "censor". as_list will tell me that the match is at (10, 16). However, if I use those indexes to find the word to replace it, it returns d cens. So the indexes appear to be offset by 2 in this case, which correspond with the number of spaces before the word "censor" in the string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugThe issue is reporting a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions