Jump to content

regexp why not match \r ?


faustf
 Share

Recommended Posts

hi guys i have  a  xml with this  code

<ScontoMaggiorazione>
                    <Tipo>SC</Tipo>
                    <Importo>30.00</Importo>
                </ScontoMaggiorazione>

i want  match  30.00  i try to do wit this regexp

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#include <File.au3>


    
    Local $aLDen = StringRegExp($string, '<Tipo>SC<\/Tipo>\n\r<Importo>(.*?)<\/Importo>', 3)
    _ArrayDisplay($aLDen,"sconto")

but not work whats wrong  ??

Link to comment
Share on other sites

Yes, but also because the newline sequence is /r/n, not /n/r :)

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

2 hours ago, faustf said:

ups  some time i am dislessic  sorry :)

To make it clear right from the beginning :
This advice is meant to be a serious help. I do not intend to insult or disparage @faustf in any way.

@faustf :

From what I can determine, your native language is Italian (which is a beautiful language :)). My problem (and maybe that of others as well) is, that sometimes I cannot even figure out what you are trying to say (in English).
Perhaps it may help you, if you take a look at the following website (it's free) :

https://www.deepl.com/translate

As far as I can judge, the quality of the translations is better than Google. You can e.g. click on individual words in the translation and a selection of alternative words will appear.

I use this site occasionally myself as a final control for long texts. My English also is far from being perfect ;).

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

\R is preferable: it matches \r or \n or \r\n according to AutoIt default PCRE options.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

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...