toonboon Posted November 15, 2012 Posted November 15, 2012 (edited) Hello, I am trying to import some mtg cards into a database for personal track-keeping. Whilst testing the program I came to an issue when processing the card information. <img src="/Handlers/Image.ashx?size=small&name=tap&type=symbol" alt="Tap" align="absbottom" />: Add <img src="/Handlers/Image.ashx?size=small&name=3&type=symbol" alt="3" align="absbottom" /> to your mana pool. <img src="/Handlers/Image.ashx?size=small&name=3&type=symbol" alt="3" align="absbottom" />: Untap Basalt Monolith. should become Basalt Monolith doesn't untap during your untap step. {T}: Add {3} to your mana pool. {3}: Untap Basalt Monolith. The code I have thus far for this is $sText = StringReplace(StringReplace(StringReplace($sText, '<img src="/Handlers/Image.ashx?size=small&name=', '') _, '&type=symbol" ', '') _, ' align="absbottom" />', '') Which makes it easier for processing with the help of a regular expression by trimming it down to this: Basalt Monolith doesn't untap during your untap step. tapalt="Tap": Add 3alt="3" to your mana pool. 3alt="3": Untap Basalt Monolith. Now the part which I actually need help with, the regular expression. Right now I have the following: $sText = StringRegExpReplace($sText, '([:alnum:]+)((alt=")(.*?{1})")', '{1}') But this doesn't work. I have no idea why, it looks correct to me, but it just doesn't. If anyone could help me with this by either just giving me a correct line of code to use or, much preferred, telling me what's wrong and explaining a solution to me. That'd be great. Edited November 15, 2012 by toonboon [right]~What can I say, I'm a Simplistic person[/right]
Moderators Melba23 Posted November 15, 2012 Moderators Posted November 15, 2012 (edited) toonboon,Have you read the Forum Rules? Please read them now - particularly the bit about not discussing game interaction - and then you will understand why you will get no help and this thread will now be locked. See below. M23 Edited November 15, 2012 by Melba23 Thread reopened Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted November 15, 2012 Moderators Posted November 15, 2012 Thread reopened after explanation. The OP has convinced me that this relates solely to the physical card version of the game and not the online version. ; -----------------------------------------------toonboon,The source you posted does not contain everything you want to extract - please post a full version so we can develop a suitable algorithm. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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