Skip to content

Support for Non-Breaking Space Characters (NBSC) ? #530

Open
@LucasMontorio

Description

@LucasMontorio

Hi everyone,

I ran into an issue while testing the following regex:

/(?:From)\s*:\s*(?:.*?<)?([^<>\s]+@[^>\s]+)(?:>)?/i

Against the following string:

'From :  John DOE <[email protected]>'

where the space character between 'From' and the column (‘:’) is a Non-Breaking Space Character (U+00A0 in Unicode).

While in a Ruby runtime this regex does not match anything because it explicitly looks for a series of regular whitespaces (\s), in the online tool there is a match.
I suppose this is because the NBSC character, when copy-pasted, is somehow sanitized into a tab character, which is then recognised as a valid whitespace.

Is there a way to add support for NBSCs in the tool? If not, does anyone have more information about the limitations at stake here? :)

Thanks a lot in advance.

PS: This was first mentioned in a little post where you can find a little more context if needed

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