I have Dynamic Action "Confirm" with text from page item (&P1_MESSAGE.). Problem is that text from page item is escaped, how I can unescape it? For example page item text is ... <b>...</b> ...<br><br>..., confirm dialog displays this text with html tags.
Have you tried to disable this option in the attributes of your Page Item ?
Security > Escape special characters
Related
So I got this regex which matches everything inside an HTML tag:
/(?<=<\s*\w+[^>]*>)(.*)(?=<\/\w+>)/gm
Playground: https://regex101.com/r/WthKUd/3
What the regex does:
(?<=<\s*\w+[^>]*>) Checks for opening HTML tag
(.*) - Checks for any character
(?=<\/\w+>) - Checks for closing HTML tag
Now I need to tweak this so that I can extract content from a tag as a List.
So given the string:
<p>Lazy fox has <b>text</b> and <b>bold text again</b></p>
And doing:
<pattern>.allMatches('<p>Lazy fox has <b>text</b> and <b>bold text again</b></p>');
The result would be:
[
'Lazy fox has ',
'<b>text</b>',
' and ',
'<b>bold text again</b>'
]
It should basically split normal text content from HTML tags so I can populate a RichText widget with the correct styles.
I have tried to modify the regex in quite a few ways but I can't seem to get it to match text as one match group and tags as another.
How would I tweak the regex to do what I want?
EDIT: I am well aware of existing parsers and we are already using flutter_html but it doesn't meet some of our needs which is why I'm creating a simpler, slimmed down version.
It's may not be the solution that you are searching for, but I used the flutter_html package for a while now, and the render is great, maybe you can switch your RichText widget to this dependency ?
With this dependency, you can choose to only render some html tags and remove some others.
sample of a user entered text paragraph is below. Users can insert a video link under [vinsert]......[/vinsert] tags. I wanted to extract the id number from inner text and replace all text from start to end of the tag so a video will display. Users can insert one or more inserts.
===================================
Dim MyStr2 As String = "Sample text [vinsert]http://www.example.com/video/34760/mytestvideo.aspx[/vinsert] Sample text sample text "
[vinsert]http://www.example.com/video/66779/testing.aspx[/vinsert] -> vidid => 666779 or 34760 is a variable which I need to extract and make a database call to find the video filename.
Dim filename As string
Select filename from myvideotable where id = vidid
I wanted to replace the [vinsert]......[/vinsert] to become the text as below.
<div class="myClass"><iframe width="560" height="315" src="//www.example.com/embed/<%= filename%>" frameborder="0" allowfullscreen></iframe></div>
I tried to use this without success: Regex, everything between 2 html tags vb.net Any help would be appreciated!
You want to use lookahead and look behind. This regex pattern should work
(?<=}\[vinsert\]).*(?=\[/vinsert\])
I want to grab the text between html tags using Dreamweaver's search and replace tool.
The link format is a standard a tag e.g.
Text
Or:
Text and Text 2
Or:
Text
I am using the following expression:
(.*)
This works fine for example 1, but it picks up everything between the first opening tag <a href and the last closing tag </a> in the case of example 2.
What can I do to just targeting each individual link?
Also, what can I do in the case of example 3 where links also have a target="_blank" property?
if you just want the "Text" in the body of the tag
<a[^>]*>([^<]*)</a>
would work
if you also want the href
<a[^>]*href="([^>"]*)"[^>]*>([^<]*)</a>
I have a variable with linebreaks, and am trying to insert it inside a textarea tag.
<textarea>{{ var_name }}</textarea>
I want the line breaks to be preserved so that it looks the same as when the variable is displayed
<div>{{ var_name|linebreaks }}</div>
Does anyone know how to do this?
Was able to solve this by replacing the \n to html code:
stringname.replace("\n", "
");
Within text area, \n appear as line breaks. As long as line breaks within your variable are encoded as \n, it should appear properly. If they are encoded differently, you can make your own custom template filter.
PS: Don't use linebreaks filter within text area because it replaces \n with html line break - <br>.
I have to edit a lot of source codes similar to each other.
random blah
random blah
blah
<table style="width: 232px; font-size: small;" cellpadding="0" cellspacing="0">....
What I want to do is to delete lines until table tag. I think I can do it with Regex search but I couldnt write the regex pattern.
Thank you
You have to go through multiple steps to do what you stated above:
Go to the replace window, select the "extended" mode, and in the "find what" field type in "\r\n" and replace them with: "LINEBREAK" (theres a space after 'LINEBREAK'). Click on replace all.
Go to the replace window again, select the "regular expression" mode, and in the "find what" field type in "(.*)(.*)(<table)(.*)(>)(.*)(.*)" and in the replace with field, type in "\2\3\4\5". Click on replace all.
Now go to replace window again, select elect the "extended" mode, and in the "find what" field type in "LINEBREAK" (theres a space after 'LINEBREAK') and replace them with: "\r\n". Click on replace all.
Notepad++ doesn't support multi line regex, which makes it hard to do what you wanted to do without going through the steps given above.
you can try something like:
(^.*$\n)*<table(.+)>
First group will match all lines before your table tag %)