Jump to content

[preg] matching java variables


dsaba

Recommended Posts

java variables can start with $ or a-z

and followed by a-z, 0-9, and _

 

Here's my attempt at matching them:

~(?<![\$_\w])(?:\$[a-z]|[a-z])[\w_]*~s

 

Yes i'm aware that such patterns can exist within java comments and string statements, but don't worry about this

 

So how can you match it?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.