Ersetzen Sie eine Spalte mit Regex in MS Access 2010

Es gibt eine Tabelle mit dem Namen sample, die nur eine Spalte body (Typ: text) in ms access 2010 enthält:

<name>John</name><age>12</age>

Ich möchte jede Zeichenfolge in den Klammern löschen. Sieh dir das an:

John12

Ich habe die Microsoft VBScript Regular Expression 5.5-Bibliothek hinzugefügt und dieses Modul erstellt:

Function Replace_Regex(str1, patrn, replStr)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True

Replace_Regex = regEx.Replace(str1, replStr)
End Function

Und dann führe ich diese Abfrage aus: update sample set body = Replace_Regex (body, "<[^>] +?", "")

Aber das Ergebnis ist:

 ame>John</name><age>12</age>

Also, was ist das Problem?

Antworten auf die Frage(1)

Ihre Antwort auf die Frage