Skip to content
Hyunseung Ryu edited this page Aug 11, 2023 · 4 revisions

startOfLine

startOfLine()

Examples

startOfLine() -> /^/

endOfLine

endOfLine()

Examples

endOfLine() -> /$/

or

or()

Examples

or() -> /|/

tab

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

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

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

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

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

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

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

linebreak()

Examples

linebreak() -> /(?:\r\n|\r|\n)/

br

br()

Examples

br() -> /(?:\r\n|\r|\n)/

then

then(item)

Parameters

name type
item string

Examples

then('abc') -> /(?:abc)/
then(p => p.find('abc')) -> /(?:abc)/

find

find(item)

Parameters

name type
item string

Examples

find('abc') -> /(?:abc)/
find(p => p.then('abc')) -> /(?:abc)/

anything

anything()

Examples

anything() -> /./

anythingBut

anythingBut(arguments)

Parameters

name type
arguments ...string

Examples

anythingBut('abc') -> /[^abc]/
anythingBut('a', ['ㄱ', 'ㅎ']) -> /[^a-]/

anythingOf

anythingOf(arguments)

Parameters

name type
arguments ...string

Examples

anythingOf('abc') -> /[abc]/
anythingOf('a', ['ㄱ', 'ㅎ']) -> /[a-]/

oneOrMore

oneOrMore([str=null])

Parameters

name type
[str=null] string

Examples

oneOrMore('abc') -> /(?:abc)+\/
then('abc').oneOrMore() -> /(?:abc)+\/

noneOrMore

noneOrMore([str=null])

Parameters

name type
[str=null] string

Examples

noneOrMore('abc') -> /(?:abc)*\/
then('abc').noneOrMore() -> /(?:abc)*\/

maybe

maybe([str=null])

Parameters

name type
[str=null] null

Examples

maybe('abc') -> /(?:abc)?/
then('abc').maybe() -> /(?:abc)?/

repeat

repeat(min, [max=null])

Parameters

name type
min number
[max=null] number

Examples

repeat(3) -> /{3,}/
repeat(3, 5) -> /{3,5}/

capture

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)/
Clone this wiki locally