-
Notifications
You must be signed in to change notification settings - Fork 0
Rules
Hyunseung Ryu edited this page Aug 11, 2023
·
4 revisions
startOfLine()
Examples
startOfLine() -> /^/
endOfLine()
Examples
endOfLine() -> /$/
or()
Examples
or() -> /|/
tab([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
tab() -> /\t/
tab(2) -> /\t{2,}/
tab(2, 4) -> /\t{2,4}/
word([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
word() -> /\w/
word(2) -> /\w{2,}/
word(2, 4) -> /\w{2,4}/
notWord([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
notWord() -> /\W/
notWord(2) -> /\W{2,}/
notWord(2, 4) -> /\W{2,4}/
digit([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
digit() -> /\d/
digit(2) -> /\d{2,}/
digit(2, 4) -> /\d{2,4}/
notDigit([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
notDigit() -> /\D/
notDigit(2) -> /\D{2,}/
notDigit(2, 4) -> /\D{2,4}/
whitespace([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
whitespace() -> /\s/
whitespace(2) -> /\s{2,}/
whitespace(2, 4) -> /\s{2,4}/
notWhitespace([min=null], [max=null])
Parameters
name | type |
---|---|
[min=null] | number |
[max=null] | number |
Examples
notWhitespace() -> /\S/
notWhitespace(2) -> /\S{2,}/
notWhitespace(2, 4) -> /\S{2,4}/
linebreak()
Examples
linebreak() -> /(?:\r\n|\r|\n)/
br()
Examples
br() -> /(?:\r\n|\r|\n)/
then(item)
Parameters
name | type |
---|---|
item | string |
Examples
then('abc') -> /(?:abc)/
then(p => p.find('abc')) -> /(?:abc)/
find(item)
Parameters
name | type |
---|---|
item | string |
Examples
find('abc') -> /(?:abc)/
find(p => p.then('abc')) -> /(?:abc)/
anything()
Examples
anything() -> /./
anythingBut(arguments)
Parameters
name | type |
---|---|
arguments | ...string |
Examples
anythingBut('abc') -> /[^abc]/
anythingBut('a', ['ㄱ', 'ㅎ']) -> /[^aㄱ-ㅎ]/
anythingOf(arguments)
Parameters
name | type |
---|---|
arguments | ...string |
Examples
anythingOf('abc') -> /[abc]/
anythingOf('a', ['ㄱ', 'ㅎ']) -> /[aㄱ-ㅎ]/
oneOrMore([str=null])
Parameters
name | type |
---|---|
[str=null] | string |
Examples
oneOrMore('abc') -> /(?:abc)+\/
then('abc').oneOrMore() -> /(?:abc)+\/
noneOrMore([str=null])
Parameters
name | type |
---|---|
[str=null] | string |
Examples
noneOrMore('abc') -> /(?:abc)*\/
then('abc').noneOrMore() -> /(?:abc)*\/
maybe([str=null])
Parameters
name | type |
---|---|
[str=null] | null |
Examples
maybe('abc') -> /(?:abc)?/
then('abc').maybe() -> /(?:abc)?/
repeat(min, [max=null])
Parameters
name | type |
---|---|
min | number |
[max=null] | number |
Examples
repeat(3) -> /{3,}/
repeat(3, 5) -> /{3,5}/
capture([item=null], pattern)
Parameters
name | type |
---|---|
[item=null] | string |
pattern | Function |
Examples
capture(p => p.find('abc')) -> /(abc)/
capture('item', p => p.find('abc')) -> /(?<item>abc)/