Extract piece of string

Hello guys,

I was wondering whether there is another alternative to extracting a certain string out from a bigger one, rather than using the function $piece.

Maybe regular expressions? Another specific function?

Example:

Big string:

NAD+SLA+++TextIsHereNAD+SLA+++TextIsHere

String I want to extract:

TextIsHere

Function I'm already using:

w $piece("NAD+SLA+++TextIsHereNAD+SLA+++TextIsHere","NAD+SLA+++",2) > Will ouput TextIsHere
w $piece("NAD+SLA+++TextIsHereNAD+SLA+++TextIsHere","NAD+SLA+++",3) > Will ouput TextIsHere

Thanks!

  • 0
  • 0
  • 334
  • 0
  • 3

Answers

Is it always at the end? .. ie after the last '+'. if so then $P(text, "+", *) will get it for you