Regular expressions: Difference between revisions

Content added Content deleted
(Added 11l)
(Regular expressions en FreeBASIC)
Line 889: Line 889:
.( No match.) cr
.( No match.) cr
[THEN]</lang>
[THEN]</lang>


=={{header|FreeBASIC}}==
<lang freebasic>
Dim As String text = "I am a text"
If Right(text, 4) = "text" Then
Print "'" + text + "' ends with 'text'"
End If

Dim As Integer i = Instr(text, "am")
text = Left(text, i - 1) + "was" + Mid(text, i + 2)
Print "replace 'am' with 'was' = " + text
Sleep
</lang>
{{out}}
<pre>'I am a text' ends with 'text'
replace 'am' with 'was' = I was a text</pre>



=={{header|Frink}}==
=={{header|Frink}}==