How do i parse this

[book-1/book-1/105, book-3/book-3/103, book-4/book-4/200, book-5/book-5/240, book-42/book-42/205, book-53/book-53/300, book-411/book-411/645, book-464/book-464/234, book-465/book-465/112]

this is what i want

book-1/105
book-3/103
book-4/200
book-5/240
book-42/205
book-53/300
book-411/645
book-464/234
book-465/112

that didn’t work

BLOCK:Parse
DISABLED
  input = @A
  leftDelim = "/"
  rightDelim = ","
  RECURSIVE
  MODE:LR
  => VAR @AA
ENDBLOCK

Try using book/ as left string. But then if you use , as right string it will skip the last one. I will give you some simple C# code to get exactly what you want, just paste this in the LoliCode instead of the parse block.

List<string> AA = A.Split(',').Select(b => b.Replace("book/", "")).ToList();

“book” is not fixed
it changes every time
just an example. i should have stated that

BLOCK:ConstantString
  value = "[book-1/book-1/105, book-3/book-3/103, book-4/book-4/200, book-5/book-5/240, book-42/book-42/205, book-53/book-53/300, book-411/book-411/645, book-464/book-464/234, book-465/book-465/112]"
  => VAR @A
ENDBLOCK

BLOCK:Parse
  input = @A
  leftDelim = "/"
  pattern = "[^\\/]+\\/([^\\/]+\\/[0-9]+)"
  outputFormat = "[1]"
  RECURSIVE
  MODE:Regex
  => VAR @AA
ENDBLOCK
2 Likes

thank you so much @Ruri