Comments (7)
Even a blind squirrel finds a nut once and a while!
from skidl.
I'm confused by this. I want to match the literal (
character at the start of the string, not start a group. All the man pages for the re
module (from 2.7 up to 3.8) state that I can use \(
or [(]
to do that. So why is this flagged as deprecated? Is this a spurious error message, or am I overlooking something?
from skidl.
@xesscorp I think the correct way to create regular expression strings to avoid any of these issues is to use a raw string: r"(\s*pad\s+([^\s)]+)"
, that avoids the issue of having to distinguish between escaping in the string (which at least in Python 3 can mean unicode escapes) and using \
in the regular expression string.
See https://stackoverflow.com/a/50504635/1398841
from skidl.
OK, I see now. I made the change to a raw string and checked it in. Thanks!
from skidl.
@xesscorp I think this was fixed in error: 27cb168
I believe you want to remove the \
before the first (
since a raw string will keep the \
now.
r"\(\s*pad\s+([^\s)]+)
r"(\s*pad\s+([^\s)]+)
from skidl.
The regex is trying to detect a starting paren of a pad definition. If I removed the \
, then the paren would be looked at as the start of a group. That's not what I want. There would also be unbalanced grouping parens: two (
and only one )
.
from skidl.
@xesscorp Ah, I see what you're saying. You're right, you did it correctly. 👍
from skidl.
Related Issues (20)
- WARNING: Could not load KiCad schematic library "Device", falling back to backup library. HOT 3
- [SKiDL Feature Request] Multiple slices to access pin numbers HOT 4
- [SKiDL BUG] Brackets not handled in component name HOT 2
- [SKiDL BUG] generate_svg() consistently raises UnboundLocalError HOT 4
- Add support for using KiCad V6 symbol libraries with generate_svg().
- [SKiDL Feature Request] - Splitting Source from Tooling Commands HOT 6
- [SKiDL BUG] ref_prefix Part parameter does not get applied if the ref_repfix parameter is already defined in a lib HOT 2
- [SKiDL Feature Request] Save a layout associated to a skidl circuit
- Skidl sometimes not respecting ```ref_prefix``` dictionary keyword HOT 3
- Skidl part parameters not carried forward into netlists
- [SKiDL BUG]incompatable with latest KiCad v7 HOT 14
- [SKiDL BUG] ERROR: No footprint for GND/#PWR1.
- Some 74xx parts don't load HOT 1
- ERC could show line defining part
- typo in error type HOT 1
- kicad 7 can double quote type
- Generate schematics for newer versions of KiCad HOT 5
- [SKiDL BUG] 1.2.0 doesn't work with the previous files HOT 4
- the function generate_pcb() can't generate PCB file HOT 1
- [SKiDL BUG] netlist_to_skidl is no more? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skidl.