Regex in some way #49

Open
opened 2025-08-06 23:23:13 +03:00 by sergeych · 2 comments
Owner
No description provided.
Author
Owner
when("text") {
    "re.*x".re -> {
    }   
}

if( text =~ "te??".re) {

}

for starters

``` when("text") { "re.*x".re -> { } } if( text =~ "te??".re) { } ``` for starters
Author
Owner

idea: add something like "matches" function that will be processed by when, if present, capable to pass match object to when block

   when(text) {
         "(.*):([0-9]+)".re -> { name, number ->
              // ...
          }
    }
    // it calls Regexp::match(text)
idea: add something like "matches" function that will be processed by `when`, if present, capable to pass match object to when block ``` when(text) { "(.*):([0-9]+)".re -> { name, number -> // ... } } // it calls Regexp::match(text) ```
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SergeychWorks/lyng#49
No description provided.