findstr, substr and getfield explainer

Run F5's findstr, substr or getfield on your string and see the match, the skip, the terminator and the result marked on a ruler, next to the plain Tcl that does the same job. Cases F5 does not document are flagged. Local, no network.

Réseau

findstr string search ?skip? ?terminator? finds the search string, skips that many characters from the start of the match, then returns up to the terminator: a length, or text to stop before.

Try

The command

findstr /login.php?user=abcdefg&lang=en user= 5 &

Result abcdefg

The string, marked

  1. /0
  2. l1
  3. o2
  4. g3
  5. i4
  6. n5
  7. .6
  8. p7
  9. h8
  10. p9
  11. ?10
  12. u11
  13. s12
  14. e13
  15. r14
  16. =15
  17. a16
  18. b17
  19. c18
  20. d19
  21. e20
  22. f21
  23. g22
  24. &23
  25. l24
  26. a25
  27. n26
  28. g27
  29. =28
  30. e29
  31. n30
  • search string found
  • skipped
  • returned
  • terminator
  • The search string starts at index 11; the result begins 5 characters after that.
  • Stopped just before &, found at index 23.
API endpointGEThttps://ronutz.com/api/v1/f5-irules-string-extractDocumented, not served. Opens the specification.

Références

Appears in these workflows