Title

Message

Confirm

<< DiscussionsReply

problem with macro and regex

Avatar from Gravatar.com
Rami Magdi30585
3 discussion posts
this is a macro i created

Code


========

1- the macro is applied to what is already in the clipboard with the assigned (shift+ctrl+c) . how can i make it copy and then apply the function?

2- i wanted to use this here but it give doesn't work !!

Code



i found the ugly that works but not really self explanatory

Code



can you help modify this to work?

Code

17 days ago (modified 17 days ago)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You can use
text= BFS.Clipboard.CopyText();
to have the macro grab the currently highlighted text.

As for this regex statement:
[\\/:"*?<>|]
. What doesn't work about it? Do you get an error? Or does the macro run but it doesn't match what you're expecting it to?
11 days ago (modified 11 days ago)  • #2
Avatar from Gravatar.com
Rami Magdi30585
3 discussion posts
10 days ago  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah, it's treating the quotation mark in the middle of that regex statement as the end of that parameter. You need to escape it with a backslash, like this:

"[\\/:\"*?<>|]"


If those two backslashes are literal as well, you need to escape each one as well, so it would be like this:

"[\\\\/:\"*?<>|]"


When you do \\ inside the quoted parameter, it's treated as one backslash. And when you do \" inside the quoted parameter, it's treated as just ".

Hope that makes sense!
9 days ago  • #4
Avatar from Gravatar.com
Rami Magdi30585
3 discussion posts
Thank you very much
it works perfectly
i would have never thought of that much escaping!
9 days ago  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Haha, no worries!
9 days ago  • #6
Was this helpful?  (1)  
<< DiscussionsReply