Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
#include <hopper.h>
|
||||
|
||||
main:
|
||||
expReg="[A-Z]{1,2}[0-9][0-9A-Z]? +[0-9][A-Z]{2}"
|
||||
flag compile = REG_EXTENDED
|
||||
flag match=0
|
||||
número de matches=10, T1=0
|
||||
|
||||
{flag compile,expReg} reg compile(T1) // compile regular expression, pointed whit T1
|
||||
{flag match,número de matches,T1,"We are at SN12 7NY for this course"},reg match, // execute
|
||||
println
|
||||
reg free(T1) // free pointer to regular expression compiled.
|
||||
|
||||
exit(0)
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
#include <hopper.h>
|
||||
|
||||
main:
|
||||
expReg="[A-Z]{1,2}[0-9][0-9A-Z]? +[0-9][A-Z]{2}"
|
||||
cadena = "We are at SN12 7NY for this course"
|
||||
flag compile = REG_EXTENDED
|
||||
flag match=0
|
||||
número de matches=10, T1=0
|
||||
|
||||
{flag compile,expReg} reg compile(T1) // compile regular expression, pointed whit T1
|
||||
{flag match,número de matches,T1,cadena},reg match, // execute
|
||||
|
||||
matches=0,mov(matches)
|
||||
reg free(T1) // free pointer to regular expression compiled.
|
||||
|
||||
From=0, To=0, toSearch=""
|
||||
[1,1]get(matches), mov(From)
|
||||
[1,2]get(matches), mov(To)
|
||||
[1,3]get(matches), mov(toSearch)
|
||||
|
||||
// substitute with "transform":
|
||||
{"another thing",toSearch,cadena}transform, println
|
||||
|
||||
// substitute with "delete"/"insert":
|
||||
{To}minus(From),plus(1), {From, cadena} delete, mov(cadena)
|
||||
{From,"another thing",cadena}insert , println
|
||||
|
||||
exit(0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue