add zajecia 6 README
This commit is contained in:
parent
23a53337b7
commit
8bc792e54d
45
README.md
45
README.md
@ -310,3 +310,48 @@ re.findall(r'^Ma', 'Ma kota Ala\nMa psa Jacek')
|
|||||||
re.findall(r'^Ma', 'Ma kota Ala\nMa psa Jacek', re.MULTILINE)
|
re.findall(r'^Ma', 'Ma kota Ala\nMa psa Jacek', re.MULTILINE)
|
||||||
```
|
```
|
||||||
#### RE.COMPILE
|
#### RE.COMPILE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## zajęcia 6
|
||||||
|
|
||||||
|
instalacja https://pypi.org/project/google-re2/
|
||||||
|
|
||||||
|
### DFA i NDFA
|
||||||
|
|
||||||
|
```
|
||||||
|
import re2 as re
|
||||||
|
n = 50
|
||||||
|
regexp = "a?"*n+"a"*n
|
||||||
|
s = "a"*n
|
||||||
|
re.match(regexp, s)
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
re.match(r"(\d)abc\1", "3abc3") # re2 nie obsługuje backreferencji
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
re2 max memory - podniesienie limitu
|
||||||
|
time # mierzenie czasu działania
|
||||||
|
|
||||||
|
|
||||||
|
gdyby ktoś chciał poczytać więcej:
|
||||||
|
https://swtch.com/~rsc/regexp/regexp1.html
|
||||||
|
|
||||||
|
### UTF-8
|
||||||
|
```
|
||||||
|
c = "ℋ"
|
||||||
|
ord(c)
|
||||||
|
chr(8459)
|
||||||
|
8* 16**2 + 0 * 16**(1) + 0*16**(0)
|
||||||
|
15*16**3 + 15* 16**2 + 15 * 16**(1) + 15*16**(0)
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
xxd -b file
|
||||||
|
xxd file
|
||||||
|
```
|
||||||
|
|
||||||
|
termin oddawania zadań - 15. listopada
|
Loading…
Reference in New Issue
Block a user