These forums are read-only. Please send questions and feedback by email.

Search Criteria

Use this forum to ask any questions and to submit bug reports

Moderator: vuser

dbrannick
Posts: 22
Joined: Tue Feb 08, 2011 8:19 am

Search Criteria

Postby dbrannick » Sat Sep 07, 2013 7:02 pm

When searching for text within a file, a name may be stored with a dash (-) or underscore (_) I.e. a-b-c or a_b_c
Is there a way I can specify a search criteria to always look for either or. Or how would I specify the search if I entered it on the search text line?
thanks.

FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Re: Search Criteria

Postby FileViewer » Sun Sep 08, 2013 2:15 am

When searching for text within a file, a name may be stored with a dash (-) or underscore (_) I.e. a-b-c or a_b_c
Is there a way I can specify a search criteria to always look for either or.

You need to use regular expressions to do this.

For example, if you wanted to find a-b or a_b, you would search for "a[-_]b" (without the quotes) and enable the Regular Expression (Regex) option.

If you wanted to find a-b-c or a_b_c you could search for "a[-_]b[-_]c". Note that this would also find a-b_c which you may not want, but there are ways of overcoming this.

Regular expressions are very powerful but can also be very confusing. If you are interested in doing more advanced searches, take a look at the Regular Expressions documentation in the help file.

dbrannick
Posts: 22
Joined: Tue Feb 08, 2011 8:19 am

Re: Search Criteria

Postby dbrannick » Thu Sep 12, 2013 2:29 pm

I tried the regular express you indicated and I'm getting a message stating 'nothing to repeat'. I selected regular expressions. Did I do something wrong?
thanks.

FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Re: Search Criteria

Postby FileViewer » Thu Sep 12, 2013 3:37 pm

I tried the regular express you indicated and I'm getting a message stating 'nothing to repeat'.

That indicates the regular expression you entered was invalid.

What *exactly* did you enter as the regular expression?

Use Google to search for regular expression tester. These sites can test regular expressions to see if they are valid.

dbrannick
Posts: 22
Joined: Tue Feb 08, 2011 8:19 am

Re: Search Criteria

Postby dbrannick » Thu Sep 19, 2013 1:12 pm

A follow up. I've created a regex expression similar to your example. Used the regex tester and it worked except I had to put a ^ in front of the expression. However when I tried it again in the search box I got the same error.

FileViewer
Site Admin
Posts: 287
Joined: Fri Apr 30, 2010 5:50 pm

Re: Search Criteria

Postby FileViewer » Thu Sep 19, 2013 3:32 pm

I've created a regex expression similar to your example

I need to know the exact regex that is giving the error message.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 22 guests