我在解決以下情況時遇到麻煩:
- 數據集中的患者敘述。 敘述描述了患者經歷的不良事件以及藥物等。 每個敘述最多可以包含20,000個字符,並且最多可以包含1000個敘述。
- 另一個數據集中約有2400個正則表達式。 正則表達式正在搜索特定條件
我需要使用所有正則表達式搜索所有敘述。 我們在Excel + VBA中有一個解決方案,但我想在JMP中實現某些功能,可能使用Text Explorer。 我使用Text Explorer和Customize Regex玩了一小組正則表達式,但結果卻令人失望。

理想情況下,我想要的是FULL NARRATIVE列旁邊的一列,其中突出顯示找到的正則表達式。
我們的VBA解決方案非常快;我嘗試使用JSL +進行循環和正則表達式來搜索所有正則表達式的一小部分敘述(23),而且速度非常慢。
這是帶有5個正則表達式的文本資源管理器搜索的代碼:
Text Explorer(
Text Columns( :FULL NARRATIVE ),
Set Regex(
Custom(
Title( "R1" ),
Example( "x" ),
Regex( "\[\bexperienc[^.]*\b(\w{4,})\b.*\bexperienc[^.]*\1\b]\" ),
Result( "\[\0]\" ),
Comment( "x" ),
Locale( "" ),
ColorStyle( 10 )
),
Custom(
Title( "R2" ),
Example( "x" ),
Regex( "\[\bexperienc[^.]*\.?[^.]*again[^.]*\.?[^.]*second[^.]*\.]\" ),
Result( "\[\0]\" ),
Comment( "x" ),
Locale( "" ),
ColorStyle( 9 )
),
Custom(
Title( "R3" ),
Example( "x" ),
Regex( "\[\bexperienc.*experienc[^.]*second[^.]*infusion[^.]*\.]\" ),
Result( "\[\0]\" ),
Comment( "x" ),
Locale( "" ),
ColorStyle( 8 )
),
Custom(
Title( "R4" ),
Example( "x" ),
Regex(
"\[\bexperienc[a-z]{0,3}\W+(\w+\W+){0,25}resolv[a-z]{0,3}\W+(\w+\W+){0,25}receiv[a-z]{0,3}\W+(\w+\W+){0,25}experienc[^.]*\.]\"
),
Result( "\[\0]\" ),
Comment( "x" ),
Locale( "" ),
ColorStyle( 7 )
),
Custom(
Title( "R5" ),
Example( "x" ),
Regex( "\[\bexperienc[^.]*again[^.]*\.]\" ),
Result( "\[\0]\" ),
Comment( "x" ),
Locale( "" ),
ColorStyle( 6 )
)
),
Layout( "Ordered" ),
Customize Regex( 0 ),
Language( "English" ),
SendToReport(
Dispatch(
{"Term and Phrase Lists"},
"",
TableBox,
{Set Summary Behavior( "Collapse" )}
)
)
);
感謝您提供有關使用文本資源管理器和/或加快正則表達式搜索的更好方法的建議。