Hello all,
Where can I find the syntax for filtering using Selection Filter widget with Regular Expressions?
I'm trying expressions like "2+1", "=2+1", etc. but they are not working...
Thanks!!
David
Filter with Regular Expression
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
- dfriasb
- Senior Member
- Posts: 119
- Joined: Thu Mar 10, 2016 1:08 pm
- Location: Calafell, Tarragona, Spain
Filter with Regular Expression
- Attachments
-
- Screenshot from 2018-01-07 10-56-02.png (325.45 KiB) Viewed 3471 times
Re: Filter with Regular Expression
Regular expressions can be used to define a search pattern. Regular expressions can be very complex, but there are also some simple but useful ones:
"ABC.*" matches layers starting with "ABC"
".*ABC" matches layers ending with "ABC"
".*ABC.*" matches layers containing "ABC"
"[1-4]" matches numbers 1 to 4
"\d" matches a digit
More information:
https://regexone.com/
http://www.rexegg.com/regex-quickstart.html
and others...
This examples would match everything on layers "layer 2" and "layer 3":
"ABC.*" matches layers starting with "ABC"
".*ABC" matches layers ending with "ABC"
".*ABC.*" matches layers containing "ABC"
"[1-4]" matches numbers 1 to 4
"\d" matches a digit
More information:
https://regexone.com/
http://www.rexegg.com/regex-quickstart.html
and others...
This examples would match everything on layers "layer 2" and "layer 3":
- dfriasb
- Senior Member
- Posts: 119
- Joined: Thu Mar 10, 2016 1:08 pm
- Location: Calafell, Tarragona, Spain
Re: Filter with Regular Expression
Very interesting!
Thank you!!
Thank you!!