SuffixRules.fromString constructor

SuffixRules.fromString(
  1. String? rules
)

Creates a new rule list from a multi-rule string.

rules is expected to contain the contents of a suffix list with one rule per line. The list is expected to follow the same format as the list at publicsuffix.org. This includes the BEGIN PRIVATE and END PRIVATE tags/comments, which are used by SuffixRulesParser.process to separate ICANN/IANA rules from private rules.

Implementation

SuffixRules.fromString(String? rules)
    : this.fromList(rules?.split(RegExp(r'[\r\n]+')));