[Solved] Search for both regex and non-regex

Discuss the spreadsheet application

[Solved] Search for both regex and non-regex

Postby RusselB » Sun Nov 17, 2019 3:40 am

I'm working with, and updating, the attached spreadsheet for a trip.
I want to work the trip so I don't hit any roads that are indicated as "HWY-" (without the quotes) and followed by a 3 digit number.
I've tried searching using HWY-, and it worked for a little bit, but was giving me hits for other highways, so I tried to incorporate [:digit:](3) into the search box of the Find & Replace dialog.
As that didn't return any results, despite the fact that I could see there should've been a match, I went back to the original search, but now that one also isn't returning any hits
I did remember to check the Regular Expressions box in More Options of the Find & Replace dialog.

If someone can provide the correct regex that I need for the search specified earlier, I would appreciate it.

While I think I've given enough information to answer my question without the file, the file is attached.....just in case.
Attachments
Ottawa.ods
(28.56 KiB) Downloaded 6 times
OpenOffice 4.1.7 and LibreOffice 6.3.3.2 on Windows 7 Pro & Ultimate
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
RusselB
Moderator
 
Posts: 5667
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Search for both regex and non-regex

Postby robleyd » Sun Nov 17, 2019 4:01 am

Try replacing the parentheses with curly brackets -
Code: Select all   Expand viewCollapse view
HWY-[:digit:]{3}
That returns a number of results from your data.
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3057
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Search for both regex and non-regex

Postby RusselB » Sun Nov 17, 2019 4:24 pm

Thanks. Might be time for another visit to the optometrist, as I couldn't see the difference between the parentheses and curly brackets, not only in the help file (which I checked before posting here), but also in your posted code, so I'm glad you also wrote out the discrepancy in words.
OpenOffice 4.1.7 and LibreOffice 6.3.3.2 on Windows 7 Pro & Ultimate
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
RusselB
Moderator
 
Posts: 5667
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Search for both regex and non-regex

Postby RoryOF » Sun Nov 17, 2019 4:43 pm

RusselB wrote:Thanks. Might be time for another visit to the optometrist, as I couldn't see the difference between the parentheses and curly brackets, not only in the help file (which I checked before posting here), but also in your posted code, so I'm glad you also wrote out the discrepancy in words.


Remember one can change the scaling of the OO type, within limits, by clicking on the A symbol top right of the OO window, just above the "logout" item.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29870
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Search for both regex and non-regex

Postby RusselB » Sun Nov 17, 2019 5:27 pm

Thanks Rory.
OpenOffice 4.1.7 and LibreOffice 6.3.3.2 on Windows 7 Pro & Ultimate
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
RusselB
Moderator
 
Posts: 5667
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON


Return to Calc

Who is online

Users browsing this forum: No registered users and 15 guests