Regular expressions: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) No edit summary |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 11: | Line 11: | ||
:* substitute part of a string using a regular expression |
:* substitute part of a string using a regular expression |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<lang 11l>V string = ‘This is a string’ |
|||
I re:‘string$’.search(string) |
|||
print(‘Ends with string.’) |
|||
string = string.replace(re:‘ a ’, ‘ another ’) |
|||
print(string)</lang> |
|||
{{out}} |
|||
<pre> |
|||
Ends with string. |
|||
This is another string |
|||
</pre> |
|||
=={{header|8th}}== |
=={{header|8th}}== |