mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
improve regex
This commit is contained in:
parent
f2e45dcbb3
commit
e78a370448
1 changed files with 2 additions and 2 deletions
|
|
@ -276,7 +276,7 @@ func (bs Service) ParseFromApi(rawContent string) (*Booking, error) {
|
|||
customerEmail := extractString(`[\w\.\-]+@[\w\.\-]+\.\w+`, content)
|
||||
customerNumber := extractInt(`Nombre de personnes : \s*\n\s*(\d+)`, content)
|
||||
commissionAmount := extractFloat(`Commission : € (\d+,\d+)`, content)
|
||||
itemName := extractString(`Maison 1 Chambre \((T2|T3) -`, content)
|
||||
itemName := extractString(`Maison . Chambre. \((T2|T3) -`, content)
|
||||
externalId := extractString(`Numéro de réservation : \n\s+(\d+)`, content)
|
||||
standardRate := extractFloat(`Standard Rate\n\s+€ (\d+)`, content)
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ func extractString(pattern, content string) string {
|
|||
|
||||
func formatDate(date string) *time.Time {
|
||||
months := map[string]string{
|
||||
"janv.": "01", "fév": "02", "mar": "03", "avr": "04",
|
||||
"janv.": "01", "févr.": "02", "mar": "03", "avr": "04",
|
||||
"mai": "05", "juin": "06", "juil.": "07", "août": "08",
|
||||
"sep": "09", "oct": "10", "nov": "11", "déc": "12",
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue