2000calories / flutter_easy_rich_text

The EasyRichText widget provides an easy way to use RichText.
https://pub.dev/packages/easy_rich_text
MIT License
80 stars 33 forks source link

could not match number string when it length is 1 or 2 #15

Closed andrie6184 closed 3 years ago

andrie6184 commented 3 years ago

for example, my origin string is "ABCDD00221", I can't match it with target string "0" or "00", "002" is OK. EasyRichText( "${item.name}(${item.code})", defaultStyle: TextStyle( fontSize: 15, color: Color(0xff333333), ), patternList: [getDefaultPattern(input)], ),

EasyRichTextPattern getDefaultPattern(String input) { return EasyRichTextPattern( targetString: input, matchOption: [0], hasSpecialCharacters: true, style: TextStyle(color: Color(0xffEF3C34)), );

andrie6184 commented 3 years ago

fix this issue with set matchWordBoundaries: false,