Row1 = cooperative. he scored 25/30 on the m_m_s_e. language was fluent. he denies
Row2 = status, cognition, and cortical functions: m_m_s_e 21/30 · ****** status (including orientation to
each row contains the keyword "m_m_s_e"
I want to return the 2 digit value that may appear on either side of the keyword
between the space and "/"
So for row1 I'd get 25
and row2 I'd get 21
Find double digit number on either side of keyword
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
How do you want to handle these MMSE scores?
If there is at most one score on a line and if you want to replace each line that contains a score with just the score, try:
If there is at most one score on a line and if you want to replace each line that contains a score with just the score, try:
If you also want to remove lines that do not contain a score, try:Find what: .*?(?:\b(\d\d)\b.*m_m_s_e|m_m_s_e.*?\b(\d\d)\b).*
Replace with: $1$2
If you can rely just on the presence of the /30 part (as MMSE scores are always out of 30), these are simpler:Find what: .*?(?:\b(\d\d)\b.*m_m_s_e|m_m_s_e.*?\b(\d\d)\b).*(\n)|.*\n
Replace with: $1$2$3
Find what: .*?\b(\d\d)/30.*
Replace with: $1$2
Find what: .*?\b(\d\d)/30.*(\n)|.*\n
Replace with: $1$2$3