Jump to content

Inquiry about how to dynamically change base64 image file in textarea


Min Su Sun

Recommended Posts

hello.

I created a method to dynamically change the base64 image file in the textarea by referring to the URL below.

1. https://community.spotfire.com/s/article/How-to-Dynamically-Change-Images-in-TextArea-in-TIBCO-Spotfire-Using-IronPython-Scripting

2 . https://community.spotfire.com/s/question/0D54z00007mxYiFCAU/changing-image-dynamically-in-text-area-in-spotfire

There are two base64 images in HTML, and I coded them in ironpython by referring to the URL above.

However, among the two images, only the first of the two images returned in the Regex.Match function returned a normal result.

There was no return value for the second image.

If there is a problem with the script, please let me know the correct method.

I will attach a screenshot of the relevant information. thank youironpython_script.bmphtml.thumb.png.d03ebec467a6f90309439f9757adff1a.pngscript_output_notpad.thumb.jpg.495d961e6bf3351976ac2de69bf9a7d3.jpg

Link to comment
Share on other sites

Hello,

Looking at https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.match?view=netframework-4.8

"This method returns the first substring found in input that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned Match object's NextMatch method. You can also retrieve all matches in a single method call by calling the Regex.Matches(String, String, RegexOptions) method."

So e.g. consider using NextMatch for subsequent matches. I did a quick test and that seemed to work as intended.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...