| View previous topic :: View next topic |
| Author |
Message |
credere35 General User

Joined: 22 Sep 2006 Posts: 5
|
Posted: Fri Sep 22, 2006 11:58 am Post subject: Help with Search/Marco paramaters. |
|
|
I wanted to know if I can run a macro or run a search that allows me to use a wild card.
Example of what I would like to accomplish.
WDC119034A1
POR285545B3
WDC1880B1
POR8545A4
I have 500,000 serials to go through and I need to search to display the serials with only for 3 alphabetical then 4 numerical not the 3 alphabetical then 6 numerical. The 3 alphabetical letters do change so a simple sort will not solve it.
Thanks,
Rick |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 7649 Location: Germany
|
Posted: Fri Sep 22, 2006 12:32 pm Post subject: |
|
|
Use a regular expression like
^[:alpha:]{3}[:digit:]{4}$
or
^[:upper:]{3}[:digit:]{4}$
with standard filter or search.
^ =starts with
[:named_class:]
{X} exactly X items of the preceeding
$ =end of string _________________ XUbuntu 9.04, OOo 3.1.1(Sun), Sun Java 1.5.0_06 |
|
| Back to top |
|
 |
credere35 General User

Joined: 22 Sep 2006 Posts: 5
|
Posted: Fri Sep 22, 2006 12:39 pm Post subject: |
|
|
| I get the error "Search Key Not Found" |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 7649 Location: Germany
|
Posted: Fri Sep 22, 2006 1:04 pm Post subject: |
|
|
Did you check option "Regular Expression"? _________________ XUbuntu 9.04, OOo 3.1.1(Sun), Sun Java 1.5.0_06 |
|
| Back to top |
|
 |
credere35 General User

Joined: 22 Sep 2006 Posts: 5
|
Posted: Fri Sep 22, 2006 1:25 pm Post subject: |
|
|
That did the trick, thank you.
One more question, what type of expression would I use to find the follow serials.
SEA_TRAIN04
I get the alpha and digit but what do I use for "_" underscore? |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 7649 Location: Germany
|
Posted: Fri Sep 22, 2006 1:51 pm Post subject: |
|
|
| credere35 wrote: | That did the trick, thank you.
One more question, what type of expression would I use to find the follow serials.
SEA_TRAIN04
I get the alpha and digit but what do I use for "_" underscore? |
The underscore has no special meaning in regular expressions. Simply use it as "_".
This finds a string, starting with 2-3 upper case letters, followed by underscore and T, followed by at least 4 letters, ending with a two digit number with leading zero (00 to 09).
^[:upper:]{2,3}_T[:alpha:]{4,}0[:digit:]$
There is at least one serious known bug: Named classes at the end of a regex do not work.
^[:upper:]{2,3}_T[:alpha:]{4,}0[:digit:] (<--missing $)
should match the same content, even if there is something behind the last digit, but the named class [:digit:] at the end is ignored.
^[:upper:]{2,3}_T[:alpha:]{4,}0[0-9] is equivalent in this case.
[A-Z] is equivalent to [:upper:] as far as english letters are concerned. ÄÖÜ do not match.
[a-z] is equivalent to [:lower:] as far as english letters are concerned. äöü do not match.
[A-Za-z] is equivalent to [:alpha:] as far as english letters are concerned. ÄÖÜäöü do not match.
All kinds of brackets and ?+*.^$\ have special meanings and must be escaped by backslash. "\*" finds a literal * "\\" finds a literal backslash.
More lenghty stuff on this:
http://www.oooforum.org/forum/viewtopic.phtml?t=43032&highlight=regex&sid=d17a2f4d4d928a4f60eae6e18007f236 _________________ XUbuntu 9.04, OOo 3.1.1(Sun), Sun Java 1.5.0_06 |
|
| Back to top |
|
 |
credere35 General User

Joined: 22 Sep 2006 Posts: 5
|
Posted: Fri Sep 22, 2006 2:58 pm Post subject: |
|
|
| once again thank you, the information was very helpful. |
|
| Back to top |
|
 |
|