verbose_regexp 1.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 65

RegExp verbose mode in Dart

Overview

This package contains a single function verbose(String) → String that can be used to simulate the verbose mode known from other RegEx implementations like python. This function will simply remove all unescaped whitespace and line comments and return a purged Dart regular expression that you can pass to the RegExp constructor.

Usage

import 'package:verbose_regexp/verbose_regexp.dart';

var a = new RegExp(verbose(r'''
  \d +  # the integral part
  \.    # the decimal point
  \d *  # some fractional digits'''));

var b = new RegExp(r'\d+\.\d*');

void main() {
  assert(a == b);
}

Changelog

1.0.0

  • Bump version to 1.0.0. Nothing changed really, but since I don't expect any design/API changes, I should have used this version number a year ago.
  • Cosmetic changes to appease pana: Add analysis_options.yaml and CHANGELOG.md.
  • Fix strong_mode and linter warnings.
  • Update repository name in pubspec.yaml.

0.1.0

  • Initial version.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  verbose_regexp: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:verbose_regexp/verbose_regexp.dart';
  
Version Uploaded Documentation Archive
1.0.0 Dec 7, 2017 Go to the documentation of verbose_regexp 1.0.0 Download verbose_regexp 1.0.0 archive
0.1.0 Jan 3, 2016 Go to the documentation of verbose_regexp 0.1.0 Download verbose_regexp 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Oct 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:verbose_regexp/verbose_regexp.dart.

Health suggestions

Format lib/verbose_regexp.dart.

Run dartfmt to format lib/verbose_regexp.dart.

Maintenance issues and suggestions

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use verbose_regexp.dart.

Dependencies

Package Constraint Resolved Available
Dev dependencies
test ^0.12.0