PDA

View Full Version : Regular expression syntax error (search)



ReedD
August 26th, 2012, 09:17 PM
In a small test file:
--------------------
()_+[]\abc
test
--------------------

The regular expressions search items \h5b and \h5c get the error message: REGULAR EXPRESSION SYNTAX ERROR (SEARCH).

Items above and below work as expected (e.g. \h5a and \h5d).

What is going wrong?

mrvedit
August 26th, 2012, 11:02 PM
I'll catch up on this and other recents posts in a few hours.

pal
August 27th, 2012, 11:49 AM
My guess is that the hex values are simply converted into actual characters and then used in the regular expression.
Since those are reserved characters, they cause syntax error.
Use \[ and \\ instead.

ReedD
August 27th, 2012, 05:36 PM
The background is that I sometimes use Vedit's regular expression search to prototype something I use with grep.
Specifically, Vedit's \hHH is used for grep -P \xHH.
(I use the GnuWin32 versions with Win7's native command shell, so escaping issues can be tricky. Using hex can simplify things.)

rejto12
March 25th, 2015, 01:48 AM
My guess is that the hex values are simply converted into actual characters and then used in the regular expression.
Since those are reserved characters, they cause syntax error.
Use \[ and \\ instead.

Thanks Pauli,

for your suggestion. So I shall add the word \\begin\{equation\} to my latex.vdf
file. In other words, I would like scribe to ignore the TeX command \begin{word}.

I take that scribe uses regular search. Anyway adding such a word, I got an angry error message. Do you have any other explanation for such an angry scribe error message.



-peter

rejto12
March 26th, 2015, 03:07 AM
Thanks Pauli,

for your suggestion. So I shall add the word \\begin\{equation\} to my latex.vdf
file. In other words, I would like scribe to ignore the TeX command \begin{word}.

I take that scribe uses regular search. Anyway adding such a word, I got an angry error message. Do you have any other explanation for such an angry scribe error message.



-peter


Pauli,

Your suggestion did the trick. Now Scribe ignores many of the Tex commands.
n short, I can use Scribe to spell check my .tex files.

So, I should send Scott an updated latex.vdf file. Since Scott does not work with Tex, may be I should send it to Ted directly ?

-peter

Scott Lambert
March 26th, 2015, 09:57 AM
Hi Peter,

I would appreciate a copy your updated latex.vdf file. You should send it to Ted too, so he can add it to the version of Scribe that comes with Vedit.

Thank you for updating it, many years have passed since Fritz (where are you now?) created the file.

Scott