Skip to content

Extracting from XML with regex #12

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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