GithubHelp home page GithubHelp logo

Comments (1)

slevithan avatar slevithan commented on July 17, 2024

@fileformat I see you've added XRegExp support in commit e2333b8, and that the XRegExp version of the tester is now live. That's awesome!

A few issues to report about the XRegExp support, though.

Not specific to XRegExp:

  • Spaces in the input show up as + signs in the results (in the input, replace, split, and exec columns). Spaces are also replaced with pluses in the regex source, which sometimes leads to syntax errors.
  • The input.replace column should be labeled input.replace(), for consistency with the other columns.
  • The input.split column should be labeled input.split(), for consistency with the other columns.
  • The regex.exec()[] column should be labeled regex.exec(), unless the split column is labeled input.split()[].

Specific to XRegExp:

  • The page should run XRegExp.install('natives') when it first loads (if running the XRegExp tester rather than native JavaScript tester), to enable the XRegExp replacement text syntax. Alternatively, you could pass the input through XRegExp.replace instead of String.prototype.replace, in which case you wouldn't need the XRegExp.install('natives') line.
  • The XRegExp flags s, x, and n are never actually applied, even when their checkboxes are checked.
  • Remove the option for flag y. XRegExp supports flag y only in JavaScript environments that natively support it (i.e., Firefox 3+). Node.js/V8 does not support flag y, so it would cause an error if RegexPlanet actually applied it.

Feature requests, specific to XRegExp:

  • Display named backreferences in the regex.exec() column. To do this, you'd need to loop over properties of the result array. In order for named backreferences to actually show up on the result array, you'd need to either run the XRegExp.install('natives') line that I mentioned earlier (after loading XRegExp), or pass the input through XRegExp.exec rather than RegExp.prototype.exec.
  • Upgrade to the latest build of XRegExp 3.0.0-pre. Even though this is not yet ready for final release, the implemented changes are at release quality, and it is unlikely that any remaining changes will affect RegexPlanet's use of it. By upgrading to v3.0.0-pre, you get several syntax changes:
    • Support for the new flag A, and its corresponding support for supplementary/astral Unicode code points.
    • Using multiple groups with the same name is now an error.
    • Using the group name length or __proto__ is now an error.
    • Single-letter Unicode categories such as \p{L} can now be written as \pL.

The full list of changes is currently in the roadmap. The release of v3.0.0-final might be delayed for a while since I need to focus on other projects, which is why I think it makes sense to go ahead and upgrade early. Flag A, in particular, would be very useful to test with.

If you have any questions, I'd be happy to help!

from regexplanet-js.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.