Add support for dotAll flag? · Issue #150 · purescript/purescript-strings · GitHub
Skip to content

Add support for dotAll flag? #150

Open

Description

@chtenb

The dotAll flag doesn't seem to be exposed in the Regex module. Could we add it?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/dotAll

Activity

  1. JordanMartinez commented on Dec 1, 2021

    @JordanMartinez
    Contributor

    Just a question. Is the dotall flag a JS-specific feature? If so, I'm guessing it can't be supported in other backends.

  2. chtenb commented on Dec 1, 2021

    @chtenb
    Author

    I'm only familiar with the JS backend. Which other backends do I need to check?

  3. JordanMartinez commented on Dec 1, 2021

    @JordanMartinez
    Contributor
  4. garyb commented on Dec 1, 2021

    @garyb
    Member

    I'd never given much thought to regex compat across backends before, it's a pretty tricky issue! Even without considering options the meaning of a regex could differ between backends.

    I was almost going to suggest regex should be split into its own js-regex library or something, but then this whole String library is generally very JS centric, given ucs-2, codepoint vs char, etc. 🤔

  5. chtenb commented on Dec 1, 2021

    @chtenb
    Author

    I wasn't aware those packages were also used when targetting other languages. TIL :)
    If we want to transparently expose the native regex implementation of each language there's bound to be differences indeed.
    Making a separate string library for each backend makes sense, but that also makes purescript generally less portable.
    If we want to abstract over string implementations and string manipulation libraries to create an opaque PureScript string library, then that may be harder to implement for each backend. I'm also not sure if that would have too much impact on string performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs more infoThis issue needs more info before any action can be done.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions