Hacker News new | past | comments | ask | show | jobs | submit login

I used perl almost exclusively before moving to python and it is very easy to use regular expressions.

Now I use python and love how it is better at separating the expression from the python language (with perl you were never sure if you had escaped things correctly)

but pyython is just... clumsy

  m = re.match(r'xyz',str)
  if m:
    do a
  else:
    m = re.match(r'wxy',str)
    if m:
      do b
    else:
      m = re.match(r'abc', str)
      if m:
        do c:
      else:
        ...
vs:

  if m := re.match(r'xyz',str):
     do a
  elif m := re.match(r'wxy',str)
     do b
  elif m := re.match(r'abc',str)
     do c
  ...



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: