this post was submitted on 24 Nov 2023
304 points (100.0% liked)

196

16822 readers
936 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

If you have any questions, feel free to contact us on our matrix channel.

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] lseif@sopuli.xyz 9 points 1 year ago (1 children)

/^[a-zA-Z_]\w*$/

i think... most languages at least

[–] anton@lemmy.blahaj.zone 3 points 1 year ago (1 children)

That's variables and keyword.

If you have a regex for a languages keywords you can substract as they are closed under that operation.

[–] lseif@sopuli.xyz 2 points 1 year ago

good point. some languages (like rust) also support r# prefix to use a keyword as a variable also