Jump to content

questions about regexp


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

 

Link to comment
Share on other sites

  • Developers

@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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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