trancexx Posted October 10, 2008 Share Posted October 10, 2008 Btw, we can (re)use \1 inside the pattern: $sWeb_Site = 'somewebsite.com' $sString = '<a href="http://' & $sWeb_Site & '">' & $sWeb_Site & '</a>' $sRet = StringRegExpReplace($sString, '(?i)<(\w+) href="http://(.*?)">\2</\1>', '\2') ConsoleWrite($sRet & @CRLF & @extended & @CRLF) Not sure why we need it, but it's good to know Wow! I didn't know ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 10, 2008 Moderators Share Posted October 10, 2008 Going back to the original problem, here is a non-regexp way of doing this using the little-used _StringBetween.... #include <array.au3> #Include <String.au3> $string = '<a href="/name/lockie" class="plain">Lockie</a> <a href="/name/aram-1" class="plain">Aram</a>' $array = _StringBetween($string,">","<") $string = _ArrayToString($array,"") MsgBox(0,"",$string)Oops, I wrote _StringBetween using RegEx as default Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
andybiochem Posted October 10, 2008 Share Posted October 10, 2008 Oops, I wrote _StringBetween using RegEx as default lol. It's a superb function anyway! - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar! 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