Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRE: (?flag) isn't properly scoped #34623

Closed
effbot mannequin opened this issue Jun 14, 2001 · 5 comments
Closed

SRE: (?flag) isn't properly scoped #34623

effbot mannequin opened this issue Jun 14, 2001 · 5 comments
Labels
topic-regex type-feature A feature request or enhancement

Comments

@effbot
Copy link
Mannequin

effbot mannequin commented Jun 14, 2001

BPO 433024
Nosy @birkenfeld, @abalkin, @serhiy-storchaka
Dependencies
  • bpo-3825: Major reworking of Python 2.5.2 re module
  • Superseder
  • bpo-2636: Adding a new regex module (compatible with re)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-08-22.00:03:21.563>
    created_at = <Date 2001-06-14.08:26:00.000>
    labels = ['expert-regex', 'type-feature']
    title = "SRE: (?flag) isn't properly scoped"
    updated_at = <Date 2014-11-08.12:27:50.938>
    user = 'https://bugs.python.org/effbot'

    bugs.python.org fields:

    activity = <Date 2014-11-08.12:27:50.938>
    actor = 'serhiy.storchaka'
    assignee = 'effbot'
    closed = True
    closed_date = <Date 2010-08-22.00:03:21.563>
    closer = 'georg.brandl'
    components = ['Regular Expressions']
    creation = <Date 2001-06-14.08:26:00.000>
    creator = 'effbot'
    dependencies = ['3825']
    files = []
    hgrepos = []
    issue_num = 433024
    keywords = []
    message_count = 5.0
    messages = ['53160', '63644', '73685', '114617', '230851']
    nosy_count = 7.0
    nosy_names = ['effbot', 'georg.brandl', 'belopolsky', 'rsc', 'timehorse', 'mrabarnett', 'serhiy.storchaka']
    pr_nums = []
    priority = 'low'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = '2636'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue433024'
    versions = ['Python 3.2']

    @effbot
    Copy link
    Mannequin Author

    effbot mannequin commented Jun 14, 2001

    from the jeffrey friedl report:

    The way (?i) works now is that if it appears anywhere
    in the regex, it turns on case-insensative matching
    for the entire regex. This is different (and less
    useful) than how Perl or Sun's Java package does it

    [I'm pretty sure SRE does it this way to exactly
    match the version of PCRE used in 1.5.2, but maybe
    it's time to move forward... /F]

    @effbot effbot mannequin self-assigned this Jun 14, 2001
    @effbot effbot mannequin added topic-regex type-feature A feature request or enhancement labels Jun 14, 2001
    @abalkin
    Copy link
    Member

    abalkin commented Mar 17, 2008

    This is still a valid issue. (As of Python 2.6a1+ (trunk:61434, Mar 17
    2008, 08:06:54).)

    >>> bool(re.match("abc(?i)","AbC"))
    True

    The documentation says that the behavior of a regex with (?<letter>) not
    at the beginning is undefined.

    Short of implementing Java/Perl behavior, this should be made an error
    rather than undefined so that users porting their code from Java/Perl
    get an early warning.

    @mrabarnett
    Copy link
    Mannequin

    mrabarnett mannequin commented Sep 24, 2008

    Implemenetd in bpo-3825.

    @birkenfeld
    Copy link
    Member

    I don't think this should be changed anymore, at least not without a flag. Anyway, it is implemented in bpo-2636.

    @serhiy-storchaka
    Copy link
    Member

    See also bpo-22493.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-regex type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants