Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # regex for use with boost regex engine (e.g. Notepad++)
- # To convert this pseudo-free-spaced text file to a "Find what" and "Replace with" usable in Notepad++, replace the following with nothing using Notepad++:
- # \t|\R(?!\R)| +#.*|^#.*\R
- (?:
- ^system(?'is_system')
- |
- \G(?'first_of_this_type'\R)?\t
- (?:
- link(?'is_link')
- |
- \t*object(?'is_object')
- )
- )
- (?|"(?'name'[^"]*)"|(?'name'.*))
- (?('is_system')\R\tpos (?'xpos'\S+) (?'ypos'\S+))
- (?:
- (?:\k'is_system'|\k'is_link')
- (?=
- (?:
- \R?^\t
- (?:
- link (?'link_follows')
- |
- ).*
- )*
- )
- )?
- (?'is_link_or_object'
- \k'is_link'(?:\R(?=\tlink )|(?'is_last_link')) # advance to next link in such a way that we'll know when we reach it that it's not the first one
- |
- \k'is_object'(?: # advance to next object in such a way that we'll know when we reach it that it's not the first one
- (?:\R\t.*)*?
- \R(?=\t+object )
- )?
- )?
- |
- ^\S.* # comment, or top-level thing that's not a system
- (?:\R\t.*)*
- |
- \G\R\t.*
- |
- ^\R
- (?{is_link_or_object}(?{first_of_this_type}:,)) # comma between link/object names
- $+{name}
- (?{is_system}
- \t$+{xpos}\t$+{ypos}
- \t # tab before links
- (?{link_follows}:\t) # tab before objects, in case of no links
- )
- (?{is_last_link}\t) # tab before objects, after last link
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement