• 51 Posts
  • 327 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle












  • alyth@lemmy.worldOPtoVanity license plates@lemmy.worldRude plate
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    3 months ago

    I think it fits the definition perfectly.

    A vanity plate or personalized plate […] is a special type of vehicle registration plate on an automobile or other vehicle. The owner of the vehicle pays extra money to have their own choice of numbers or letters, usually portraying a recognizable phrase, slogan, or abbreviation, on their plate. https://en.wikipedia.org/wiki/Vanity_plate

    One difference is that in Germany you may only pay for the 2nd and 3rd part of the registration number. The 1st part is the area where the car is registered, like you said. Another difference is that in Germany vanity plates are so cheap that they’re the norm rather than the exception. The translation for vanity plate is Wunschkennzeichen btw, which is a term that most German speakers are familiar with.












  • Thanks for sharing this. I took the time to read through the documentation of the re module. Here’s my review of the functions.

    Useful:

    • re.finditer returns an iterator over all Match objects
    • re.search returns the first Match object or None if there are no matches.
    • r'' use raw strings for patters so you don’t have to worry about backslashes
    • the optional flags argument modifies the behaviour (case insensitive, multiline)

    Utility:

    • re.sub replace each match in the string
    • re.split split a string by a regular expression

    The Match object:

    • match.groups(0) returns the portion of text matched by the pattern
    • match.groups(1) returns the first capturing group
    • match.groups(2) returns the second capturing group, and so on

    I don’t understand why these exist:

    • re.match like search, but only matches at the beginning of the string. why not just use ‘^’ or ‘\A’ in the pattern you pass to ‘search’?
    • re.fullmatch like ‘search’, but only if the full string matches. Why not just use ‘\A’ and ‘\Z’ in the pattern you pass to ‘search’?
    • re.findall Returns all matches. It seems like a shitty version of ‘finditer’. The function has three different return types which depend on the pattern you pattern you pass to the function. Who wants to work with that?