Input: Hi #[Pill(google.0.LastName)], How is going #[Pill(google.0.FirstName)]?
this Input has regex expression of const pillRegex = /#\[dataPill\((.*)\)\]/i;
#[Pill(google.0.LastName)]
and #[Pill(google.0.LastName)]
are the matching results.
I want to build an array with objects and indicate if the value is matched or not. (If you have better data structure, you can use it)
[
{
pill: false, //not matched
svalue: 'Hi ' //value
}, {
pill: true, //matching regex
svalue: ["google", "0", "Last Name"]] //the value
},
...
]