RegEx searched string includes backslash

How can I search a string of lettres and numbers in RegEx, that includes backslashes?
This does not work:code[/code]
I am just not able to find a wildcard for \

“You can escape the backslash by doubling it: \”,“BBCode”

Thanks Beatrix. But I can’t escape them, as they are in a variable string I am searching. I would need a wildcard for the backslash. Strangely, \\x7B\\x5Ccolortbl(?X:.+)\\x7D works on this string:


While it doesn’t work in this one:

{\\colortbl;\\red255\\green255\\blue255;\\red128\\green128\\blue128;\\red255\\green250\\blue131;\\red0\\green0\\blue0; \\red255\\green255\\blue10;\\red255\\green255\\blue10;\\red0\\green0\\blue0;}

What do you mean with wildcard? What is your purpose?

Maybe this would be easier if you gave an example of your data and what fragments you are trying to extract from it so people could experiment.

@Beatrix: A wildcard according to Xojo documentation is for example a dot “.” =Any single character except a line break, including a space.

@Greg: May search Pattern and two different strings to search I posted two posts above. I am trying to extract the whole strings.

The wildcard always is “.”. It includes the \. That’s why I was asking what you mean.

Split your string by \ and remove the brackets.

A dot doesn’t match a newline unless you tell it otherwise through RegEx.Options or a switch, but this pattern may be all you need:


BTW, you can match anything literally by putting it between \Q and \E, for example:

... matches ...

Dear Kem, as ever you are the best and I can learn a whole lot from you! Thanks.