Jump to content

Recommended Posts

Posted

Hey, I'm not that great with String Replace or String Strip where the exact string is not known.

 

I need to be able to strip the following:

"2015">2015

Where 2015 may not be known. I need to basically strip the side "*>  where * behaves like a wild card and leaves only the right side 2015.

Length will not be known. It will not always be numerical.

It may be " * > or < * > but I can set these for each column according to which way it is set up. 

Please help. Just need a basic understanding of how to identify and replace the pattern with ""

 

Posted

Thanks for your reply. Here are a few examples.


                                <span title="111">111

                                <span title="3.5L 6 cyl Fuel Injection">3.5L 6 cyl Fuel Injection

                                <span title="Ultra White">Ultra White

                                <span title="Black/garnet">Black/garnet

Posted

This is what I have so far. Yours works great for the numerical portions.

StringReplace(StringRegExpReplace($Array2[0], "\>.*", ""), '"', "")

Posted

Ok so using your code I've been able to clear everything except 

"
                 title="$44,900"

 

StringReplace(StringRegExpReplace($Array2[0], ".*>", ""), '"', "")

Posted
StringRegExpReplace($Array2[0], '<\V+title="([^"]+)".+', "$1")

 

$string = 'title="$44,900"'
$String2 = StringRegExpReplace($string, '<\V+title="([^"]+)".+', "$1")
Consolewrite($String2 & @CRLF)

 

Doesn't look like that one works. 

Posted

This is what I am using on that single one for now. StringStripWS(StringReplace(StringReplace($Array2[0], 'title="$', ''), '"', ''), $STR_STRIPALL)

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...