|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Lets say I have a sentence, $sentence. To check if $sentence has the the line "In this world", what's the regular expression?
|
|
#2
|
|||
|
|||
|
if($sentence =~ /In this world/) {
#do this } To replace words, you use this: $sentence =~ s/old words/new words/ig; Only use the 'i' in the end if you want it to be case insensitive. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Easy regular expression question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|