>>>>> "Steve" == Steve Downing <[EMAIL PROTECTED]> writes:
Steve> I have a large number of BASIC source-code files I want to scan
Steve> and replace certain parts of text. To complicate things, there
Steve> are three strings I need to match, and I'm really only
Steve> interested in the numbers (1 to 63) which come at the end of
Steve> the string. The search-replace script I am writing is being
Steve> done in Python.
Steve> Individually the following regexs work:
Steve> (?i)\bMbeSettings\.level *= *(\d\d?\b) (?i)\bActive level
Steve> (\d\d?\b) (?i)\blv *= *(\d\d?\b)
Steve> BUT if I try combining them to something like this:
Steve> (?i)(?:\bMbeSettings\.level *= *(?P<ln>\d\d?\b))| (?:\bActive
Steve> level (?P=ln))| (?:\blv *= *(?P=ln))
Try adding another pair of parentheses around the first term...
((?i)(?:\bMbeSettings\.level *= *(?P<ln>\d\d?\b)))| ...
Peter c
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug