Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> /^(?:\/(?:\\\/|[^\/\n])+\/[gimuy]{0,5}|\\[^\n]|[^\n\\\/])+$/

What would you say was the query for this?



The regular version of ChatGPT can explain it pretty well. I asked it about your regex and it gave me a detailed breakdown; it's a bit too long to post it here but just to quote the [gimuy] part:

> [gimuy]{0,5}: This part of the pattern matches optional regex flags that can follow the closing forward slash of the regex pattern. The allowed flags are g (global), i (case-insensitive), m (multiline), u (unicode), and y (sticky). This part of the pattern matches zero to five of these flags, without repetition.

Full response: https://gist.github.com/nicolasff/3bbfb4cb8a514f58e140b887bf...




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

Search: