File: rx_lookarounds

package info (click to toggle)
nqp 2022.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,436 kB
  • sloc: java: 28,030; perl: 3,394; ansic: 451; makefile: 200; javascript: 68; sh: 1
file content (54 lines) | stat: -rw-r--r-- 2,491 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## lookarounds
<before .d> a.		abacad		/mob: <ad @ 4>/			lookahead <before>
<before c> ....		abacad		n				lookahead <before>
<before> .		abcd		n				null <before>
<!before ..b> aa	aabaaa		/mob: <aa @ 3>/			negated lookahead
# todo :any<after>
<after a>b		ab		y				lookbehind <after>
# todo :any<after>
<after a>b		cb		n				lookbehind <after>
# todo :any<after>
<after a>b		b		n				lookbehind <after>
# todo :any<after>
<!after c>b		ab		y				lookbehind <!after>
# todo :any<after>
<!after c>b		cb		n				lookbehind <!after>
# todo :any<after>
<!after c>b		b		y				lookbehind <!after>
# todo :any<after>
<!after <[cd]>>b	dbcb		n				lookbehind <!after>
# todo :any<after>
<!after <[cd]>><[ab]>	dbaacb		y				lookbehind <!after>
# todo :any<after>
<!after c|d>b		dbcb		n				lookbehind <!after>
# todo :any<after>
<!after c|d><[ab]>	dbaacb		y				lookbehind <!after>
# todo :any<after>
<!after cd><[ab]>	cbaccb		y				lookbehind <!after>
# todo :any<after>
$ <after ^a>		a		y				lookbehind <after>
# todo :any<after>
<after x+>y		axxbxxyc	y				lookbehind <after>
<[a..z]>+		az		y				metasyntax with leading + (<+...>)
<+[a..z]>+		az		y				metasyntax with leading + (<+...>)
<+alpha>+		az		y				metasyntax with leading + (<+...>)

<?>			''		y		null pattern (<?>)
^ <?>		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
<?> $		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
abc <?> def	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
x | y | <?>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)
x | y | <?>	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	y	null pattern (<?>)

abc <!> def	\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	n	fail pattern <!>

# todo :any<parsing>
a[b}		\t\n\r !"#$%&'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij	/error/	mismatched close

c <before .d>		abacad		/mob: <c @ 3>/				one character and lookahead <before>
.* <before .d>		abacad		/mob: <abac @ 0>/			multiple characters and lookahead <before>
.* <before .\<>		abaca<d		/mob: <abac @ 0>/			multiple characters and lookahead <before> with a '<'
.* <before \<>		aba<ca<d		/mob: <aba<ca @ 0>/		greedy any character and lookahead <before> with a '<'
.*? <before \<>		aba<ca<d		/mob: <aba @ 0>/		non-greedy any character and lookahead <before> with a '<'

## vim: noexpandtab tabstop=4 shiftwidth=4