Aeterna Posted April 18, 2009 Posted April 18, 2009 I'm taking information of a webpage that has google feed linksexample: http://www.google.com/alerts/feeds/1001429...773879324373026StringRegExp($body, "http://www.google.com/alerts/feeds/ (digits) / (digits))"It looks like theres 20 digits in the first block and 19 in the second, but is there a better way than doing /d/d/d/d/d/d etc... ?
ProgAndy Posted April 18, 2009 Posted April 18, 2009 (edited) try (\d+) or (\d{19}) and (\d{20}) \d+ matches at least one digit followed by as many digits as possible \d{19} matches 19 digits \d{20} ... guess ... 20 digits, right. Edited April 18, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
Aeterna Posted April 18, 2009 Author Posted April 18, 2009 hmm, maybe I'm doing something wrong.CODEFunc GetLinks() _IENavigate($oIE, "http://www.google.com/alerts/manage?hl=en&gl=us") _IELoadWait($oIE) $body = _IEBodyReadHTML($oIE) $links = StringRegExp($body, "(\D+)(\d+)(\D)(\d+)", 1) For $link in $links FileWriteLine($FeedFile, $link) NextEndFunchttp://www.google.com/alerts/feeds/1001429...773879324373026There's a bunch of links that look like that, just the digits are different, i want to take each entire link and write it as a line in $FeedFile.Any ideas?
ProgAndy Posted April 18, 2009 Posted April 18, 2009 you have to set the brackets in an other way: $link = "text text text text text http://www.google.com/alerts/feeds/10014295542174222516/2316773879324373026 tesxt tesxt tesxt " $links = StringRegExp($link,"(http://\D+\d+\D\d+)",3) For $i = 0 To UBound($links)-1 ConsoleWrite($links[$i] & @CRLF) Next *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
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