Control Compliance Suite

 View Only
  • 1.  custom check creation

    Posted Jun 22, 2016 11:53 PM

    I would like to ask about check creation

     

    if i want to check whether 'connectionTimeout="60000' like "screenshot1.png" as attached. i can use the check "screenshot2.png" as attached

    i tested it and it is working fine. however, if there is some words behind the string... it is failed (please see the example as screenshot3.png)

     

    what element do i need to use to check whether the particular string exists or not among other stings?

     

    thanks



  • 2.  RE: custom check creation
    Best Answer

    Posted Jun 23, 2016 02:54 AM

    Hi Lee,

    use this: /^connectionTimeout="60000"\s+.*$/m

    The reason your regexp did not work is because "\s*$" means: zero or more spaces followed by end of line. What I did "\s+.*$" means:
    \s+  - one or more spaces
    .* - any character zero or more time
    $ - end of line

    This will match your string

    connectionTimeout="60000" asdf

    but not

    connectionTimeout="60000"asdf

    which would be probably bad entry in the config file.

    Great resource for learning regular expressions is http://www.regular-expressions.info/
    And also CCS uses .NET implementation so if you want to test your regexp you can use http://regexhero.net/tester/ or some other online/freeware tester.