Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Regular-expressions/MUMPS/regular-expressions.mumps
Normal file
13
Task/Regular-expressions/MUMPS/regular-expressions.mumps
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
REGEXP
|
||||
NEW HI,W,PATTERN,BOOLEAN
|
||||
SET HI="Hello, world!",W="world"
|
||||
SET PATTERN=".E1"""_W_""".E"
|
||||
SET BOOLEAN=HI?@PATTERN
|
||||
WRITE "Source string - '"_HI_"'",!
|
||||
WRITE "Partial string - '"_W_"'",!
|
||||
WRITE "Pattern string created is - '"_PATTERN_"'",!
|
||||
WRITE "Match? ",$SELECT(BOOLEAN:"YES",'BOOLEAN:"No"),!
|
||||
;
|
||||
SET BOOLEAN=$FIND(HI,W)
|
||||
IF BOOLEAN>0 WRITE $PIECE(HI,W,1)_"string"_$PIECE(HI,W,2)
|
||||
QUIT
|
||||
Loading…
Add table
Add a link
Reference in a new issue