Questions tagged [tre-library]

TRE is a library for approximate regular expression matching.

TRE is written in C and offers bindings for Perl, Python and Haskell.

It extends non-fuzzy regular expression matching by defining the number and weight of error that will still lead to a positive match.

4 questions
52
votes
6 answers

Fuzzy Regular Expressions

In my work I have with great results used approximate string matching algorithms such as Damerau–Levenshtein distance to make my code less vulnerable to spelling mistakes. Now I have a need to match strings against simple regular expressions such TV…
Thomas Ahle
  • 30,774
  • 21
  • 92
  • 114
5
votes
3 answers

approximate RegEx in python with TRE: strange unicode behavior

I am trying to use the TRE-library in python to match misspelled input. It is important, that it does handle utf-8 encoded Strings well. an example: The German capital's name is Berlin, but from the pronunciation it is the same, if people would…
vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
5
votes
3 answers

Loading c libraries from php

in a recent project I've come really need the lib tre matching library. However the project is in php, and there are no php bindings for the library. I've tried to google how to create an interface for c libs, but all I found was the dl function…
Thomas Ahle
  • 30,774
  • 21
  • 92
  • 114
2
votes
1 answer

Finding multiple regex hits using approximate matching via the tre library

Using C, I'm trying to find the location and number of matches of a substring within another parent string. Because I also need to include approximate (hamming distance) matches, I'm using the tre library found here: http://laurikari.net/tre/. I'm…
David M
  • 710
  • 1
  • 8
  • 14