Regular expressions on the values that arrive, with RE2.
One outlet per capture group of the pattern, named after the group when it has a name: (?P<temp>\d+) makes a "temp" outlet. The outlets keep their cables when the pattern is edited, as long as the group keeps its name, or its number for unnamed groups.
RE2 matches in linear time, whatever the pattern: a pattern cannot stall the audio thread. It has no back-references inside the pattern, nor look-around. Compiling is not bounded that way: an edit of the pattern during playback is compiled by the worker, off the audio thread, within RE2's memory budget.
|
|
| halp_meta (name, "Regex") halp_meta(c_name |
| |
|
avnd_regex | halp_meta (category, "Control/Mappings") halp_meta(author |
| |
|
avnd_regex ossia score | halp_meta (description, "Match, search, replace or split text with a regular expression (RE2 syntax). " "Each capture group gets an outlet, named after the group for (?P<name>...). " "Numbers and lists are matched as their text.") halp_meta(uuid |
| |
|
void | setError (std::string message) |
| |
|
void | apply (Compiled &&c) |
| |
| void | compile () |
| |
|
ossia::value | groupValue (re2::StringPiece s) const |
| | A group as sent: its text, or the number it is when Numbers is on.
|
| |
| std::vector< ossia::value > | sendGroups (int64_t ts) |
| |
|
void | process (const ossia::value &input, int64_t ts) |
| |
|
void | operator() (const tick &t) |
| |
|
|
struct { | |
| |
|
struct { | |
| |
|
The text to process Numbers and lists are their text | |
| |
|
an impulse processes the last input again ossia::value_port * value {} | |
| |
| } input | |
| |
|
pattern | |
| |
|
mode | |
| |
|
replacement | |
| |
|
global | |
| |
|
ignore_case | |
| |
|
multiline | |
| |
|
numbers | |
| |
| } | inputs | |
| |
|
struct { | |
| |
|
struct { | |
| |
|
The match | |
| |
|
Search all: the list of matches | |
| |
|
Replace : " "the text replaced | |
| |
|
Split : the list of pieces") ossia::value_port* value{} | |
| |
| } match | |
| |
|
struct { | |
| |
|
The groups of the match | |
| |
|
The groups of the as a list | |
| |
|
Search all: a list " "per match") ossia::value_port* value{} | |
| |
| } groups | |
| |
|
struct { | |
| |
|
true or false | |
| |
|
true or for every input ossia::value_port * value {} | |
| |
| } matched | |
| |
|
struct { | |
| |
|
The input | |
| |
|
The when it does not match ossia::value_port * value {} | |
| |
| } unmatched | |
| |
|
struct { | |
| |
|
Why the pattern or the replacement is not valid | |
| |
|
an empty string once they are ossia::value_port * value {} | |
| |
| } error | |
| |
|
halp::keyed_dynamic_port< capture_port > captures | |
| |
| } | outputs | |
| |
|
ossia::exec_state_facade | ossia_state |
| |
|
struct ao::Regex::worker | worker |
| |
|
std::unique_ptr< RE2 > | re |
| |
|
std::string | rewrite |
| |
|
std::string | error_text |
| |
|
bool | error_pending {} |
| | Error text not sent yet; a failure after success and the reverse.
|
| |
|
bool | had_error {} |
| |
|
std::vector< re2::StringPiece > | submatches |
| |
|
std::string | last_text |
| |
|
std::string | text |
| |
|
uint64_t | generation {} |
| |