Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab middle of the list #280

Open
sfs-pra opened this issue Dec 13, 2024 · 2 comments
Open

Grab middle of the list #280

sfs-pra opened this issue Dec 13, 2024 · 2 comments

Comments

@sfs-pra
Copy link
Contributor

sfs-pra commented Dec 13, 2024

scanner {   
  Exec("printf "1\n2\n3"") {  
    Fst = Grab(First)
    Lst = Grab(Last)
  }                                                                                                                          
} 

How to get 2?

@LBCrion
Copy link
Owner

LBCrion commented Dec 13, 2024 via email

@sfs-pra
Copy link
Contributor Author

sfs-pra commented Dec 14, 2024

Line number will come in handy
I have to invent ugly designs

Exec("echo '#1# #2# #3#'") {
    Hlp  = Regex("#([^#]*)#") #1
    Hlp1 = Regex("#[^#]*#\\s*#([^#]*)#") #2
    Hlp3 = Regex("\"[^\"]*\"\\s*\"[^\"]*\"\\s*\"([^\"]*)\"") #3
    Hlp4 = Regex("\"[^\"]*\"\\s*\"[^\"]*\"\\s*\"[^\"]*\"\\s*\"([^\"]*)\"") #4
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants