Skip to content

Extracting from XML with regex #12

@ocram

Description

@ocram

The following regex may also work for extracting strings from XML when a file is uploaded to import:

/<\s*?(string|plurals|string-array).*?name\s*?=\s*?"\s*?([^"]+)\s*?".*?>(.*?)<\s*?\/\s*?\1\s*?\s*?>/gis

Results:

  • \1 = type
  • \2 = key/name
  • \3 = contents

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions