verbose_regexp 1.0.0+1

RegExp verbose mode in Dart #

Build Status

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+1 #

  • Add SDK constraint so the package can be used in Dart 2.0.0.
  • Run dartfmt --fix.

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+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub 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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Aug 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and verbose_regexp.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0