Skip to content

Better string functions in expressions #1527

@sc1f

Description

@sc1f

Feature Request

Description of Problem:

Some common string functions for parsing and creating new strings should be added to the expressions engine using ExprTk:

  • substring(str, start_idx, end_idx) => str[start_idx:end_idx], inclusive of start, exclusive of end (like Python)
  • find(str, regex) => index in str where regex matches
  • match(str, regex) => substring of str where regex matches
  • replace(base_str, regex, replacement) => base_str with replacement at the first match of regex
  • replace(base_str, regex, replacement) => base_str with replacement at all matches of regex
  • contains(str, substr) => true if substr in str

Metadata

Metadata

Assignees

Labels

C++enhancementFeature requests or improvements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions