In a LaTeX report I am making I have to write a regex. There is only one in the whole report, so I don't really want to use packages and so on.
This is the regex I am talking about:
^\"((\w|\s)+)\"$
I came up with this for LaTeX:
\grave{ }\backslash\"'((\backslash w\| \backslash s)+)\backslash \"' \backslash \$
This gives me like 10 errors, and I can't really see what is wrong. Okay, it looks pretty bad but all the commands should work.
Thanks in advance,
Harm
Use \verb/^\"((\w|\s)+)\"$/
Perhaps the problem is that some of those commands (\backslash, \grave) want to be in math mode, but \" doesn't. Have you tried using \verb to include the regexp verbatim? I'm not sure if it'll look like you want (it'll be typeset in a tt font), but you could do this with something like:
...
In my project I'm using a regexp \verb@^\"((\w|\s)+)\"@ to do a thing.
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With