New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expressions does not work #5636

Closed
bjoernboldt opened this Issue Aug 1, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@bjoernboldt

bjoernboldt commented Aug 1, 2018

I use a regular expression in my mapfile to find all items with 'abc' in the middle
i.e.
CLASSITEM "FLD01"
CLASS
EXPRESSION /.*abc.*/
..
END
It works fine in 7.0.7 and before, but got an error (loadClass(): Unknown identifier. Parsing error near (*): line xxx) in 7.2.0 (and 7.3.0).
When I am trying /.+abc.+/ it works in 7.2.0 too. Any ideas?

@geographika

This comment has been minimized.

Contributor

geographika commented Aug 4, 2018

As a guess it could be related to the multi-line comments implementation #5362

@sdlime

This comment has been minimized.

Member

sdlime commented Aug 6, 2018

@sdlime sdlime self-assigned this Aug 6, 2018

@sdlime

This comment has been minimized.

Member

sdlime commented Aug 6, 2018

In the meantime I believe a workaround would be something like:

EXPRESSION ("[FLD01]" ~".abc.")

--Steve

@bjoernboldt

This comment has been minimized.

bjoernboldt commented Aug 7, 2018

Thanks. This helps a lot.

@bjoernboldt bjoernboldt closed this Aug 7, 2018

@sdlime sdlime reopened this Aug 7, 2018

@sdlime

This comment has been minimized.

Member

sdlime commented Aug 7, 2018

While there is a workaround, if this is really related to the multi-line comment addition then there really is a bug since /.*abc.*/ is not a properly formed comment and shouldn't be causing a problem. I suspect there is an error with the regex associated with that functionality... --Steve

@sdlime

This comment has been minimized.

Member

sdlime commented Aug 14, 2018

Found the issue - the expression in the lexer for regex EXPRESSIONs - it was too general. --Steve

@sdlime sdlime closed this Aug 14, 2018

geographika added a commit to geographika/mapserver that referenced this issue Aug 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment