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 TextIsHereThanks!
Discussion (3)0
Comments
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…
$EXTRACT can also be used for substringing, and should prove useful
Is it always at the end? .. ie after the last '+'. if so then $P(text, "+", *) will get it for you