randexp
0.0.1, released 5 years ago by an unverified publisher
Create random strings that match a given regular expression.
WASM-ready
What it does
Generates random strings that match a given regular expression object in Dart. It supports grouping, piping, character sets, ranges, back-references, and custom PRNGs.
AI-written summary of version 0.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to generate random test data matching specific regex patterns.
- You want to create mock strings for form inputs or validation testing.
Skip it when
- You need to parse or validate regular expressions rather than generate strings from them.
Strengths
- Supports a wide range of regex features like groups, piping, and back-references.
- Allows custom PRNGs for seeded or cryptographic randomness.
- Configurable maximum repetition for infinite repetitional tokens.
Weaknesses
- Some badly placed positional or negated character sets cannot match anything and return empty strings.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'package:randexp/randexp.dart';
void main() {
RandExp(RegExp(r'hello+ (world|to you)')).gen();
}Alternatives
Packages that do the same job and could replace randexp.
- flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare - validators2
String validation and sanitization for Dart.
83Compare - fraction
Create, parse, and perform arithmetic operations with fractions and mixed fractions.
84Compare - template_expressions
A Dart library to process string-based templates using expressions.
62Compare