Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
/Test-RulesPublic archive

Test Rules used for verifying the SRL implementation.

License

NotificationsYou must be signed in to change notification settings

SimpleRegex/Test-Rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test rules are made to verify that your implementation of SRL is valid.These files contain simple tests to validate the SRL and thecorresponding results. The structure is easy to understand and implement.

Structure of a .rule File

These rules are required to build valid test rules:

  • All files used for testing must end with the extension.rule and atleast contain one valid assertion along with the SRL query.
  • The query is defined throughsrl: on the beginning of a line.
  • All strings that should match are defined throughmatch: on thebeginning of a line.
    • There can be unlimitedmatch: lines per rule.
    • Each match must be surrounded by".
  • All strings that shouldnot match are defined throughno match:on the beginning of a line.
    • There can be unlimitedno match: lines per rule.
    • Each match must be surrounded by".
  • If a capture group is defined, its result can be defined as follows:
    • The line must begin withcapture for.
    • Surrounded by", the test string to match must be provided, followed by a:.
    • If a named group is desired, use the following syntax:name: "result"
    • If a anonymous group is desired, just supply"result".
    • Separate multiple captures using,.
    • If one expression returns multiple matches, supply the same test string in the second line.
  • The query as well as the expectations must not exceed one line.If required, new lines can be forced using\n. Tabs using\t.
  • Comments must be on a separate line and start with a#.

Example .rule Files

# This is a sample rule with a named capture groupsrl: capture (letter twice) as "foo"capture for "aa1":- 0: foo: "aa"match: "example"match: "aa2"no match: "a"
# This is a sample rule with an anonymous capture group and multiple resultssrl: capture (digit)capture for "123":- 0: 0: "1"- 1: 0: "2"- 2: 0: "3"capture for "01":- 0: 0: "0"- 1: 0: "1"

About

Test Rules used for verifying the SRL implementation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp