Tech
A Dart regex that cannot be made to hang
FFI binding to Google's RE2. Matching runs in linear time, so no catastrophic backtracking.
Here is a validator that ships in a lot of Dart code. It checks that a string is a list of words separated by single spaces:
final ok = RegExp ( r'^(\w+\s?)*$' );
It works. Type a name, a tag list, a short label, and it returns true or false quickly. Then someone sends 31 characters of x with no trailing separator and the isolate stops answering.
I timed it. On Apple S...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to