![tes3cmd multipatch command tes3cmd multipatch command](https://desktop.arcgis.com/fr/arcmap/latest/tools/3d-analyst-toolbox/GUID-817B10D6-FE90-44AA-8A64-77E637020523-web.png)
Regular expressions are a deep subject, and they can be confusing. We use this as the string that represents an object reference is a multi-line string, where each line is a different sub-record and we want to match multiple subrecords (the NAME, which contains the potion ID and DATA which contains the Angles). Normally "." is special in that it does not match the newline character at the end of a line. In this case the "s" means to treat the string we are matching as a single-line, or in other words "." is not special. The initial (?s) is a way to add options to how the regular expression works. We can add an alternative to also match for the y_angle: So if any number other than 0 appears after the "x_angle:" and before a space, we should have a match. matches any string that does not contain "0", "." or " " (space). Note that "." inside brackets just matches the period. * - matches any string containing only "0" and ".", repeated zero or more times. Normally "*" and "+" are greedy, which means they match repeated regular expressions of the longest length, but adding the question mark at the end of a regular expression means to do a non-greedy or minimal match.Ĭontinuing on, we want a pattern that matches a non-zero X/Y angle. and ".+?" means match any character repeated one or more times but only with the minimum number of characters. ".+" means match any character repeated one or more times. Note that "." by itself means match any character. This confirms we have chosen a good pattern for matching potion IDs. If our pattern was chosen correctly, we should only see objects of type ALCH matching, and that is what we see. In this case I replaced "name:" with "^" which anchors the patter to the start of the string.
![tes3cmd multipatch command tes3cmd multipatch command](https://flylib.com/books/2/770/1/html/2/files/02fig55.jpg)
Tes3cmd dump -id "^(potion_|p_(vintage|.+?_(unique|)$))" -no-banner -list Morrowind.esm So, let's test our pattern and see if any other record types (not ALCH) match: There is also the potion "p_vintagecomberrybrandy1" so we can add that as yet another alternative to the stuff that comes after "p_": įurther observation shows that some potion IDs end in "_unique" instead of the, so we add that to our pattern as an altenative: So the pattern above matches potion IDs that begin with either "potion_" or "p_" and in the latter case, when ended by one of. And \b matches a word boundary (such as between the end of a word and a space that follows). The parentheses and vertical bar are used to specify alternative patterns. We know that in a cell, object reference names are preceeded with "name:" so that will start our pattern. To match what we have observed so far, we would write a pattern like this: It turns out you can, but I only found that out after confirming it with a test. So, the idea one might start with is that you can construct a pattern that will reliably match all the potion IDs. And in the case when it starts with "p_" it ends with "_b", "_c", "_e", "_q", or "_s". On linux, it's even handier to be able to sort the output by piping to "sort", but in any case, notice that potion IDs start with "p_" or "potion_". Tes3cmd dump -no-banner -list -type alch Morrowind.esm The first thing to note is that potion IDs have a pattern to them.
Tes3cmd multipatch command software#
(Note: \B in this post should be lowercase b, forum software is mangling stuff, it also converted some of them into smileys. The subject of advanced regular expression matching came up in another thread, so I thought I'd post more here.