Regular expressions: Difference between revisions

m
→‎{{header|REXX}}: added titles for the REXX programs. -- ~~~~
(→‎{{header|REXX}}: add REXX examples modeled after PERL examples. -- ~~~~)
m (→‎{{header|REXX}}: added titles for the REXX programs. -- ~~~~)
Line 1,286:
<br><br>It is also possible to emulate regular expressions through appropriate coding techniques.
<br><br>All of the following REXX examples are modeled after the '''PERL''' examples.
<br>
'''testing'''
<lang rexx>/*REXX program demonstrates testing (modeled after Perl example).*/
$string = "I am a string"
Line 1,309 ⟶ 1,311:
It does not contain the word: ring
</pre>
'''substitution &nbsp; (destructive)'''
<lang rexx>/*REXX program demonstrates substitution (modeled after Perl example).*/
$string = "I am a string"
Line 1,326 ⟶ 1,329:
The changed string is: I am another string
</pre>
'''substitution &nbsp; (non-destructive)'''
<lang rexx>/*REXX program shows non-destructive sub. (modeled after Perl example).*/
$string = "I am a string"
Line 1,345 ⟶ 1,349:
The changed string is: I am another string
</pre>
'''test and substitute'''
<lang rexx>/*REXX program shows test and substitute (modeled after Perl example).*/
$string = "I am a string"