Jump to content

Recommended Posts

hi guys  i have this pageweb  with  this code

<li class="list-inline-item">
                <span class="price">
                                 400.000</span>
                        <span class="price"></span>
                    </li>
        </ul>

i try to match  400.000  with this code  but i dont know  why in regexpbuddy work  but in autoit not 

Local $aLPrezzi = StringRegExp($sLHtmlPage, '<span class="price">\r\n(.*?)\/span', $STR_REGEXPARRAYGLOBALMATCH)

anyone can helpme??

thankz

 

Share this post


Link to post
Share on other sites

@faustf,

You've been here this long and are still not posting a runnable script to simulate your issue which people can test with.
Wonder whether you will ever learn?

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

sorry @Jos  you can remove  my post ??

thankz

 

P.S.

habits die hard

sorry

 

Share this post


Link to post
Share on other sites

No, I would prefer you simply post an script that shows the issue so we can help you. ;)

 


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Trying to guess the possible issues and using the provided infos, may I suggest this pattern

'<span class="price">\s*([^<]+)'

 

Share this post


Link to post
Share on other sites
Posted (edited)
11 hours ago, faustf said:

hi guys  i have this pageweb  with  this code

<li class="list-inline-item">
                <span class="price">
                                 400.000</span>
                        <span class="price"></span>
                    </li>
        </ul>

i try to match  400.000  with this code  but i dont know  why in regexpbuddy work  but in autoit not 

Local $aLPrezzi = StringRegExp($sLHtmlPage, '<span class="price">\r\n(.*?)\/span', $STR_REGEXPARRAYGLOBALMATCH)

anyone can helpme??

thankz

 

 

If you copy and paste your HTML snippet into a unicode text editor, right after the first span tag but before the CRLF, for some odd reason, there is a U+FEFF (Zero Width Non-Breaking Space/BOM).  So if your snippet of HTML is accurate, that is why your regular expression probably was not finding any matches.  Also, because U+FEFF is a not considered one of the whitespace (\s) regular expression characters, it is why the regular expression supplied by @mikell will not work either.  I'm not sure how the BOM got there, whether it is there in error, or whether it truly is a part of your HTML.  But if it is truly a part of the HTML body, then you will need to handle it in your regular expression.

Edited by TheXman

Share this post


Link to post
Share on other sites

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

×
×
  • Create New...