Regular expressions: Difference between revisions

Content added Content deleted
m (→‎Icon and Unicon: header simplification)
Line 380: Line 380:
WRITE(ClipBoard) string ! Th** q****ck br**wn f**x j**mps **v**r th** l**zy d**g</lang>
WRITE(ClipBoard) string ! Th** q****ck br**wn f**x j**mps **v**r th** l**zy d**g</lang>


== Icon and Unicon ==
=={{header|Icon}} and {{header|Unicon}}==
The {{libheader|Icon Programming Library}} provides [http://www.cs.arizona.edu/icon/library/procs/regexp.htm regexp]. Regex includes procedures to provide access to regular expressions within native string scanning and matching expressions. 'ReFind' and 'ReMatch' respectively generate the sequence of beginning and ending positions matched by a regular expression. Additionally, there is a regular expression pattern compiler 'RePat' and other supporting functions and variables.
Regex includes procedures to provide access to regular expressions within native string scanning and matching expressions. 'ReFind' and 'ReMatch' respectively generate the sequence of beginning and ending positions matched by a regular expression. Additionally, there is a regular expression pattern compiler 'RePat' and other supporting functions and variables.


==={{header|Icon}}===
<lang Icon>procedure main()
<lang Icon>procedure main()


Line 396: Line 395:


link regexp # link to IPL regexp </lang>
link regexp # link to IPL regexp </lang>
{{libheader|Icon Programming Library}}
[http://www.cs.arizona.edu/icon/library/procs/regexp.htm See regexp].


Sample output:<pre>"A simple string" matches "string$"
Sample output:<pre>"A simple string" matches "string$"
"A simple replacement"</pre>
"A simple replacement"</pre>

==={{header|Unicon}}===
The Icon solution works in Unicon.


=={{header|Inform 7}}==
=={{header|Inform 7}}==