Skip to content

re.error: multiple repeat at position 10 #1

Description

@tetedange13

Hi there,

With python 3.9 + GTF from NCBI, I get following error:

Traceback (most recent call last):
  File "/bioinfo/conda_envs/genPanels/bin/generate-panel", line 7, in <module>
    sys.exit(script())
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/site-packages/generate_panel.py", line 461, in script
    main(args)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/site-packages/generate_panel.py", line 283, in main
    gtf_df = parse_gtf(args.gtf, args.source, chromosomes)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/site-packages/generate_panel.py", line 96, in parse_gtf
    match = re.findall(pattern, attribute)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/re.py", line 241, in findall
    return _compile(pattern, flags).findall(string)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/re.py", line 304, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_compile.py", line 788, in compile
    p = sre_parse.parse(p, flags)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_parse.py", line 955, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_parse.py", line 841, in _parse
    p = _parse_sub(source, state, sub_verbose, nested + 1)
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/bioinfo/conda_envs/genPanels/lib/python3.9/sre_parse.py", line 672, in _parse
    raise source.error("multiple repeat",
re.error: multiple repeat at position 10

Are you sure about your pattern ?

pattern = r'(.*?) "(.*+)'

=> In 2nd matching group ".+*" is not a valid regexp I guess ?

I tried with r'(.*?) "(.+)' and error is gone

Thanks !
Felix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions