[issue34315] Regex not evalauated correctly

2019-02-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

For case-insensitive matching you can use the re.IGNORECASE flag.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2019-02-22 Thread noah


noah  added the comment:

I was able to recreate the 'bad' output on Linux using 'bad' input.

The issue is caused when you misspell WHERE, regex is looking for the exact 
word "WHERE", any lowercase (where), multicase (WHeRe), or misspelling (WERE) 
is going to cause it to return None because regex didn't find a matching 
substring.

I also on a whim tested out a bunch of encodings before realizing it didn't run 
on bytes objects anyways, so really the only way to get this output is to 
misspell the input. I think this problem should probably be closed as it's not 
a bug with the python core.

--
nosy: +ngwood111
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2019-02-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The regular expression engine is not platform depended.

Please check that you run the same code.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2018-09-11 Thread hongweipeng


hongweipeng  added the comment:

In my test in win2012r2, it works well. Add a screenshot.

--
nosy: +hongweipeng
Added file: https://bugs.python.org/file47794/win12r2py3.7.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2018-08-02 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34315] Regex not evalauated correctly

2018-08-01 Thread Raman


New submission from Raman :

Sample code below

import re

regex = 
r'DELETE\s*(?P[a-zA-z_0-9]*)\s*FROM\s*(?P[a-zA-z_0-9]+)\s*([a-zA-Z0-9_]*)\s*(?PWHERE){0,1}(\s.)*?'

test_str = 'DELETE FROM my_table1 t_ WHERE id in (1,2,3)'

matches = re.finditer(regex, test_str, re.MULTILINE)

print([m.groupdict() for m in matches])

Below is the expected output.

[{'table_alias': '', 'table_name': 'my_table1', 'where_statement': 'WHERE'}]

But in Win Server 2012 R2, the output is
[{'table_alias': '', 'table_name': 'mytable1', 'where_statement': None}]

Using 3.7 in Win Server 2012 R2 also the output is not as expected. But in Win 
10 and other linux variants, expected output is obtained.

--
components: Regular Expressions
messages: 322916
nosy: ezio.melotti, mrabarnett, ram, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Regex not evalauated correctly
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com