Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting Text Until Specified Character Is Reached
#5
Is it possible with this code to retrieve "DEF" from the below 3 cases (in each case the caret is at a different position, caret is represented by a pipe symbol.)

Code:
Copy      Help
ABC DE|F GHI
ABC |DEF GHI
ABC DEF| GHI

I tried to use regex wordboundry \b but I could not get the syntax right:

Macro Macro35
Code:
Copy      Help
2
;test in the below line (retrieve "DEF")
;ABC DEF GHI

str rgx="\b"
str s
s=SelectTextRightUntil(rgx 16|2)
out s
s=SelectTextLeftUntil(rgx 16|2)
out s

I put the caret at the 3 positions (left of string, in the string and on the right of the string) and then run the above code.
But it does not retrieve "DEF".

(the goal is to get the text at caret position)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)