Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check text and edit if..
#1
Hi,

I'm looking to check a string of text that looks like one of the following:

????
or
???? (Ref:????)

If the string of text looks like the second option, i'm wanting to copy the ???? in the brackets and delete the " (RefSmile" part.

Is this possible?
#2
Macro
Code:
Copy      Help
str s="abcd (Ref:efgh)"
str s2
if(findrx(s "^.+ \(Ref:(.+)\)$" 0 0 s2 1)>=0)
,out s2
,
#3
Thanks Gintaras,

Can you show me how to set s to be what is on the clipboard?
#4
Macro
Code:
Copy      Help
str s
s.getclip ;;makes s equal to what's in the clipboard.
s.setclip ;;makes the clipboard equal to what s is.
An old blog on QM coding and automation.

The Macro Hook
#5
Thanks, that worked great! Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)