this Posted April 13, 2009 Share Posted April 13, 2009 (edited) Say I have the string "2 Dollars" and I wanted to use a regular expression to match "Dollars" as well as the digit before it but only replace "Dollars" with "Cents" to make "2 Cents" with something like "[0-9] Dollars". Is that possible? Edited April 13, 2009 by this UDFsWinSineInOutResize () - Resize a window smoothly based on a sine curve. Link to comment Share on other sites More sharing options...
Authenticity Posted April 13, 2009 Share Posted April 13, 2009 $sText = StringRegExpReplace($sText, '(?i)(\d+\s+)Dollars', '\1Cents') ConsoleWrite($sText & @LF) Link to comment Share on other sites More sharing options...
this Posted April 13, 2009 Author Share Posted April 13, 2009 Thanks! UDFsWinSineInOutResize () - Resize a window smoothly based on a sine curve. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now