google / textfsm

Python module for parsing semi-structured text into python tables.
Apache License 2.0
1.09k stars 168 forks source link

TextFSM and german "umlaute" re.unicode option #49

Closed hendriklenz closed 5 years ago

hendriklenz commented 5 years ago

Hello,

I use TextFSM and want to use German umlauts like ä,ö and ü in the regular expressions. When I test the regular expression in an editor this works. If I use the expression in a TextFSM template, the values with umlauts are not read. Can TextFSM handle such characters (öäü)? If so, how?

I use that expression:

Value Required posten ([\w üöä.-]{28})

Many thanks and greetings Hendrik

hendriklenz commented 5 years ago

I think it's because the regex module is used without the option re.unicode. Could that be the cause?

If so, is it possible to use the re.unicode function with TextFSM?

hendriklenz commented 5 years ago

The problem is solved. I have used Python version 2.7. After an upgrade to version 3.7 it works now.

harro commented 4 years ago

The current python-v3 pull request should address the issue for python2.7 as well.