Allow me to use groupdict()['a'] to refer to what the [ A ] thing (actually (?P<identifier>match)) has captured, please.

In other way, I'm looking for a "Levenshtein" with omits/skippings/blanks/neglects, and pick out what has been skipped as well.

In another way, I'm looking for a fuzzy(a.k.a. approximate) regex that can be less strict with the pattern, still provides the good old groupdict(), as well as a "fuzziness" value (or "edit distance", required to determine "the best matched pattern to the string" later).
This is the preferred solution, since it provides "sufficient" groupdict() if well managed.
However, The TRE library and the REGEX library, which is found to be the closest solution, don't seem to provide a "fuzziness" value. If this can be solved, then so much the better!

Is that possible? Thanks for paying attention.

Update:

I decided to use the powerful regex module in the end, but still unable to get the "fuzziness value".

Since the question on this page is theoratically solved, appending too further will be dishonorable. So I put forward another question about this new issue, and hopes you could solve it!

You may consider using Damerau–Levenshtein rather than plain Levenshtein as it will consider “naem” to have a distance of 1 from “name” rather than 2, not that it helps you with your problem.
–
icktoofayJun 10 '13 at 4:40

Yes, I am using DL in production. To simplify the question, I only referred to it as a normal Levenshtein. What's more, in fact, I don't really care about what the fuzzy algrithm is. Thank you for your reminders, as they will delight those who have not enjoyed DL~! @icktoofay
–
tslmyJun 10 '13 at 9:23

Errrrr... Allow me to ask how can I use this library in my Python code? The python\setup.py.in seems to need win32\Release\tre.dll which is nonexistent.
–
tslmyJun 10 '13 at 8:59

Update: After some Googling, I found this to be a easlier alternative... maybe?
–
tslmyJun 10 '13 at 9:18

Well, I am choosing this answer for now. I decided to use the powerful regex module in the end, but still unable to get the "fuzziness value". Since the question on this page is theoratically solved, appending too further will be dishonorable. So I put forward another question about this new issue, and hopes you could solve it!
–
tslmyJun 10 '13 at 12:34

Hehe~ You can improve it by using [a-z] instead of \w depending on your needs, since \w will also match _ and digits
–
HamZaJun 10 '13 at 9:24

Sorry, there's tons of such patterns to match, so, being extremely lazy, I can't afford to manage it. BTW, it mush took you some time to compose this pattern, right?
–
tslmyJun 10 '13 at 9:36

@tslmy Hmmm didn't really mention the time, but I would think about 10mn. I think it would depend on how fluent you're in regex, I'm writing regex here on SO almost every day xD. BTW you gave me a nice idea to write something that automates the process for writing this regex. Something in PHP to generate a regex like I did here under "Breaking the laws of regex".
–
HamZaJun 10 '13 at 9:40

1

You can also use tools like this guy that make writing reliable regexes much less painful
–
joel.dJun 10 '13 at 23:07