01-14-2019 10:57 AM
Hello,
In the attached VI, how do you go about deleting just the first block of text from <table> to </table> while leaving the other blocks intact?
Thanks.
Solved! Go to Solution.
01-14-2019 01:24 PM
What you need to do is to break the string down into three pieces by doing two matches (which, itself, gives you three pieces, "before the match", "match", and "after the match"). First, look for <table>, and save the "before-the-match" string. Now look for </table> and save the "after-the-match" string. Concatenate the "before" and "after" strings, and you have your result.
This seems like a curious question for someone who has been a member of the LabVIEW Forum Community for 12 years (!!) to be asking. Have you been doing LabVIEW for more than a decade and never used the String functions?
Bob Schor
01-14-2019 02:54 PM
01-16-2019 06:21 AM - edited 01-16-2019 06:24 AM
As for a solution...
Set the Search and Replace String to match regular expressions (right click it).
Then use "(?s)<table>.+?</table>" as a search string.
(?s) = "." matches all characters
<table> = matches "<table>"
.+? = non-greedy match. Match as few characters as possible
</table> = matches "</table>"
You could also use Match Regular Expression function for this, and use the after match output. You get the match and before match as a bonus. It also opens possibilities to get the match between <table> and </table> by using "(?s)<table>(.+?)</table>" and then using the 1st capturing group (submatch output of MRE when extracted).
01-22-2019 04:18 PM - edited 01-22-2019 04:26 PM
Nothing here