텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?텍스트 상자나 텍스트 편집 상자에 하이퍼링크를 삽입하는 방법이 있습니까?표현식 열 유형을 사용하여 JMP 테이블에서 이 작업을 수행할 수 있고 하이퍼링크처럼 작동하는 창에 버튼 상자를 생성할 수 있다는 것을 알고 있습니다.나는 또한 텍스트 상자에 대한 << 마크업 구문을 알고 있지만 이 구문에서는 굵게, 밑줄, 기울임꼴만 사용할 수 있습니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?매우 멋진 접근 방식 @ih
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?결합 @바이런_JMP 의 웹 브라우저 상자 아이디어를 사용하면 정규식 문자열을 사용하여 내장된 링크가 있는 형식화된 HTML 파일을 저장하고 이를 창에 표시할 수 있습니다.갑자기 텍스트 서식을 제어할 수 있게 되었습니다. 사용자가 선택적으로 [JMP 웹사이트]와 같은 링크 구문에 친숙한 이름을 추가하도록 할 수도 있습니다. http://www.jmp.com , 일부 마크업 구문과 유사합니다.

Names Default To Here( 1 );
text = "Periarthritis is defined as: Inflammation of the tissues around a joint. " ||
"[A Link]http://www.reference.md/files/D010/mD010489.html As arthralgia, myalgia, tendonitis " ||
"and other musculoskeletal issues are listed events, periarthritis can be considered listed as well.
Comment: no good sentinel case — not a new signal; one case also reported somnolence and " ||
"another case reported “yawny” which could mean sleepy *http://www.ncbi.nlm.nih.gov/pubmed/12530994";
t = text;
//wrap links in a string with <A href="https://community.jmp.com/" target="_blank"> tags
findlinks = function({t, recct=0}, {url_regex, rgxmatch = {}, rtn=""},
recct++;
if(recct > 100,
throw("Recursion to deep: " || char(recct) || " levels. Still need to parse: '" || t || "'"));
url_regex = "^(.*?)(\!\[(.+)\])?((https?://){0,}(\w+\.){2,}\w+/?(\w+/?){0,}(\.\w+){0,1}/?)(\b.*)$";
rgxmatch = Regex Match(t, url_regex);
if( N Items(rgxmatch) == 0,
rtn = t, //No link
if( N Items(rgxmatch) == 10, //found a link
rtn = rgxmatch[2] ||
"</A><A href="" || rgxmatch[5] || "" target="_blank" rel="nofollow noopener noreferrer">" || if(is missing(rgxmatch[4]), rgxmatch[5], rgxmatch[4] ) || "</A>" ||
findlinks(rgxmatch[10], recct),
throw("Error matching regex in: '" || t || "'")
)
);
return(rtn)
);
//Create a simple html page from a block of text, save it to the temp files, and return the filename
texttohtmlfile = function({t},
Save text file("$TEMP/Temp HTML file.html", "" || findlinks(t) || "")
);
//Make a temp html file
fn = texttohtmlfile(text);
//Simple window to display html file, deletes the temp file when it closes
w = New Window("Example",wb = Web Browser Box());
w << On Close( Delete File( fn ) );
wb << Set Size(1000, 200);
wb << Set Auto Stretching( 1, 1 );
wb << Set Max Size( 1000, 1000 );
//Show the html file in the window
wb << Navigate( fn );"\["가 '이스케이프 문자' 섹션을 시작하므로 정규식 일치 표현식에서 불행하게도 슬래시가 발생하는 점에 유의하세요.
스크린샷을 추가하고 오타를 수정하여 다시 편집했습니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?Mark님의 제안에 감사드립니다.그러나 사용자가 URL에 태그를 삽입하는 것을 원하지 않습니다.내 상사는 꽤 잘 작동하는 정규식을 생각해 냈습니다.
// Sample text
text = "Periarthritis is defined as: Inflammation of the tissues around a joint. " ||
"http://www.reference.md/files/D010/mD010489.html As arthralgia, myalgia, tendonitis " ||
"and other musculoskeletal issues are listed events, periarthritis can be considered listed as well.
Comment: no good sentinel case — not a new signal; one case also reported somnolence and " ||
"another case reported “yawny” which could mean sleepy *http://www.ncbi.nlm.nih.gov/pubmed/12530994";
url_regex = "\b(https?://){0,}(\w+\.){2,}\w+/?(\w+/?){0,}(\.\w+){0,1}/?\b";
text_list = {};
link_list = {};
keep_going = 1;
istart = 1;
text_len = length(text);
i = 0;
while(keep_going,
new_text = substr(text, istart);
link_text = regex(new_text, url_regex);
if (!is missing(link_text),
// then
i++;
start_pos = contains(text, link_text, istart);
text_list[i] = substr(text, istart, (start_pos - istart - 1));
link_list[i] = link_text;
istart = start_pos + length(link_text);
,
// else no link found
i++;
text_list[i] = new_text;
keep_going = 0;
);
);
tb = {};
lb = {};
nt = nitems(text_list);
nw = new window("Test link",
vb = vlistbox(
)
);
for(i = 1, i <= nt, i++,
tb[i] = text box(text_list[i], << set width(400));
vb << append(tb[i]);
if (i < nt,
one_button = evalinsert("\[lb[i] = button box("^link_list[i]^", web("^link_list[i]^"), << underline style(1) )]\");
eval(parse(one_button));
vb << append(lb[i]);
);
);
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?Regex() 함수를 참조하세요. 유용할 수도 있습니다. 정규식은 매우 간단합니다.
Names Default to Here( 1 );
text = "Periarthritis is defined as: Inflammation of the tissues around a joint. " ||
"<L>http://www.reference.md/files/D010/mD010489.html</L> As arthralgia, myalgia, tendonitis " ||
"and other musculoskeletal issues are listed events, periarthritis can be considered listed as well.
Comment: no good sentinel case — not a new signal; one case also reported somnolence and " ||
"another case reported “yawny” which could mean sleepy *<L>http://www.ncbi.nlm.nih.gov/pubmed/12530994</L>";
Regex( text,
"<L>(.+?)</L>",
"\1"
);
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?지금까지 귀하의 의견과 제안에 감사드립니다.나는 사용자 댓글에서 URL이 어디에 있는지 알 여유가 없습니다.
다음은 몇 가지 샘플 출력입니다.

다음은 몇 가지 샘플 코드입니다.URL "마커" 및 을 사용하여 쉽게 만들었습니다.나는 이러한 마커를 사용하지 않기 위해 정규식을 사용하여 URL 위치를 가지고 놀았습니다.URL을 찾는 데 유용한 정규식을 갖고 있는 사람이 있으면 알려주세요.나는 지금까지 인터넷에서 찾은 내용으로 다양한 성공을 거두었습니다.
// link markup example
text = "Periarthritis is defined as: Inflammation of the tissues around a joint. " ||
"<L>http://www.reference.md/files/D010/mD010489.html</L> As arthralgia, myalgia, tendonitis " ||
"and other musculoskeletal issues are listed events, periarthritis can be considered listed as well.
Comment: no good sentinel case — not a new signal; one case also reported somnolence and " ||
"another case reported “yawny” which could mean sleepy *<L>http://www.ncbi.nlm.nih.gov/pubmed/12530994</L>";
text_list = {};
link_list = {};
keep_going = 1;
istart = 1;
linkstart = "<L>";
linkend = "</L>";
text_len = length(text);
i = 0;
while(keep_going,
start_pos = contains(text, linkstart, istart);
if (start_pos,
end_pos = contains(text, linkend, istart);
if (end_pos,
i++;
text_list[i] = substr(text, istart, (start_pos - istart));
link_list[i] = substr(text, start_pos + 3, (end_pos - start_pos - 3));
istart = istart + end_pos - istart + 4;
);
);
if (!start_pos,
i++;
text_list[i] = substr(text, istart);
keep_going = 0;
);
);
tb = {};
lb = {};
nt = nitems(text_list);
nw = new window("Test link",
vb = vlistbox(
)
);
for(i = 1, i <= nt, i++,
tb[i] = text box(text_list[i], << set width(400));
vb << append(tb[i]);
if (i < nt,
one_button = evalinsert("\[lb[i] = button box("^link_list[i]^", web("^link_list[i]^"), << underline style(1) )]\");
eval(parse(one_button));
vb << append(lb[i]);
);
);
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?아 그리고 마우스박스(textBox)를 여러 번 사용할 수 있는 함수나 표현식으로 만드세요. 여기서는 발견된 링크인 텍스트만 변경됩니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?이 솔루션에는 WrapListBox와 MouseBox라는 약간의 추가 항목이 필요합니다.
Names Default To Here( 1 );
New Window( "WrapListBox",
Wrap List Box(
TextBox("This is a long comment to be followed by a link "),
MouseBox(TextBox(" <U>http://www.jmp.com</U> ",<<FONT color="">");
web(lnk);
(this<<CHILD></CHILD></FONT>
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?정규식을 사용하여 하이퍼링크 패턴을 일치시킬 수 있습니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?HTML 링크에 대한 텍스트 상자 내용을 구문 분석한 다음("//:http"로 시작하는 패턴 찾기) 각 패턴에 대해 링크가 포함된 텍스트 상자에 버튼 상자를 추가하는 것이 가능할 수 있다고 생각합니다. 파싱됩니다.
그래도 꽤 복잡할 겁니다. 링크가 텍스트에서 인식되고 클릭 가능하다면 훨씬 더 좋을 것입니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?전체 상자가 링크가 되어도 괜찮다면 버튼 상자를 사용할 수 있습니다.
New Window( "Example",
Text box("Text Block 1"),
Button box( "http://www.jmp.com/", Web( "http://www.jmp.com/" ), Underline Style( 1 ) )
)Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?Byron에게 감사합니다. 멋진 스크립트입니다.하지만 그것은 내가 찾던 것이 아니었습니다.특히 텍스트 상자에 링크를 삽입하고 클릭할 수 있도록 하고 싶습니다.내 사용자는 길이가 길고 참조 링크를 포함할 수 있는 댓글을 입력하고 있습니다.링크를 구문 분석하고 표시하는 접근 방식을 연구 중입니다.
텍스트 블록1(텍스트 상자 내)
링크1 (클릭 가능한 링크로)
텍스트 블록2(텍스트 상자 내)
링크2 (클릭 가능한 링크로)
텍스트 블록3
등.
아마 사용자들이 받아들일 수 있을 것입니다.
Re: 텍스트 상자 또는 텍스트 편집 상자에 하이퍼링크가 있습니까?나는 당신이 이것보다 더 정교한 것을 찾고 있다고 생각하지만 ...
Names Default To Here( 1 );
New Window( "Example",
hlistbox("1",
wb = Web Browser Box(),
bb=Button Box( "Take Me to JMP",
wb << Navigate( "http://www.jmp.com" );
wb << Set Auto Stretching( 1, 1 );
wb << Set Max Size( 1000, 1000 );
)));