Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regexp literal #21697

Closed
DartBot opened this issue Nov 22, 2014 · 3 comments
Closed

regexp literal #21697

DartBot opened this issue Nov 22, 2014 · 3 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Nov 22, 2014

This issue was originally filed by [email protected]


One of the only things I like about JavaScript is RegExp literals. Any chance of that being implemented?

@lrhn
Copy link
Member

lrhn commented Nov 22, 2014

With Dart's raw strings, the need for an explicit RegExp literal is much less than if you had to double-escape your back-slashes.

You can make a helper function, so you have to write even less:

 RegExp re(String source, [String flags]) =>
   new RegExp(source,
              caseSensitive: !flags.contains("i"),
              multiLine: flags.contains("m"));

then a RegExp may be written as only:
   var trimLinesRE = re(r"^\s+|\s+$", "m");


Added Area-Language, Triaged labels.

@srawlins
Copy link
Member

Duplicate of issue #289

@gbracha
Copy link
Contributor

gbracha commented Dec 23, 2014

Added Duplicate label.
Marked as being merged into #289.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Dec 23, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants