August 20, 2008, 08:48:48 am *
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: regular expression support  (Read 3529 times)
grayger
Newbie
*
Posts: 1


« on: September 21, 2007, 01:42:06 am »

It is a great tool!

I am enjoying it, but I can't find how to check some basic rules.
For example, there is well-known Java coding standard: Class name starts with uppercase.
If string.matches() supports regular expression, it could be possible.

Do you have any idea?
Logged
Oege de Moor
Newbie
*
Posts: 30


« Reply #1 on: September 23, 2007, 10:42:24 am »

Glad you like SemmleCode, and sorry for the delay in replying.

We've added string operations, and they'll be available in the next release - this
will enable you to write the "class name starts with uppercase" query.
Full regexp support is also in the pipeline, but a bit more difficult to support
on all the different database backends.

The next release will come out in a few days.
Logged
elnar
Administrator
Newbie
*****
Posts: 17


« Reply #2 on: September 30, 2007, 10:20:52 pm »

The new release of SemmleCode plugin has now four new functions on strings: length, substring, toUpperCase and toLowerCase. Using these methods one can easily express a query to find all reference types that have names that do not start with an upper case letter. Here is one example:

Code:
from RefType t, string s
where s = t.getName().substring(1,1)
and s.toUpperCase() != s
select t

Enjoy!
Logged
Pages: [1]
  Print  
 
Jump to: