Giter Club home page Giter Club logo

Comments (2)

tfmorris avatar tfmorris commented on May 14, 2024

From [email protected] on May 17, 2010 03:05:54:
I've managed to narrow it down to the special hyphen character in the regex, but I'm
not yet sure why that causes the code to fail. The actual exception thrown is this:

Traceback (most recent call last):
File "", line 5, in _temp_
File "/home/vishal/Workspace/metaweb/freebase-gridworks-read-
only/lib/jython/re.py", line 142, in search
return _compile(pattern, flags).search(string)
File "/home/vishal/Workspace/metaweb/freebase-gridworks-read-
only/lib/jython/re.py", line 241, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat

I'm still investigating.

from openrefine.

tfmorris avatar tfmorris commented on May 14, 2024

From [email protected] on May 17, 2010 04:51:06:
Raymond, I found that this works

import re
g = re.search(ur"\u2014 (._),\s_BWV", value)
return g.group(1)

Could you check? Note the unicode character as well as the ur prefix. Unfortunately, I don't know a quick way
to encode unicode characters within jython code without writing a parser for it. So right now you'd have to do
the encoding yourself. I did this by first using GEL on the expression "—".unicode(), which gives 8212, and
then converting that from decimal to hex.

from openrefine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.