extractLink property

String? get extractLink

Extracts URL from this string.

Example:

final text = 'Please visit https://example.com';
final url = text.extractLink;
// returns: 'https://example.com'

Implementation

String? get extractLink =>
    RegExp(r'(https?://[^\s]+)').firstMatch(this)?.group(0);