It's not a secret anymore!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UrlyByrd: wild characters and search question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UrlyByrd: wild characters and search question" Watch "UrlyByrd: wild characters and search question" New topic

UrlyByrd: wild characters and search question

Michael Vargenstien
Ranch Hand

Joined: Jan 27, 2007
Posts: 61
Hello fellow grasshoppers and zen masters,

I have a question regarding the searching data that is allowed to be inputed. The requirements state that that the flex should be "flexible" that being nice and vague makes things about as crystal clear as poo poo. Here is where I'm going with all of this....

Should we account for the meta characters, groupings, etc as part of the searching critieria or is it enough to not allow the user to enter the characters? Or.... do you need to pad the metacharacters appropriatly?

MetaCharacters and the good old back slash of hell:

Character What it represents Example

Any Represents the character typed, with the exception of special characters defined below A represents A, B represents B etc

. Any character(except line breaks) Will match c, 3, [SPACE] etc

\d Any digit Will match 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9

\D Any non-digit Will match anything except 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9

^ Beginning of line

$ End of line

\t [TAB] \thello matches "hello" preceded by a tab

\r Line Break [RETURN]

\s Whitespace Matches any whitespace character: [SPACE], [TAB], Line Break, New Line

\S Non whitespace Matches any non whitespace character

\w Word characters Typically letters, numbers and underscores

\W Non word characters Matches any non word character

\character A character that is normally a special character Special characters are: . # ^ $ \ ? + * | [ ] ( )

[any series of characters] Any characters inside the brackets [abc] matches a, b or c

[any character - another character] Any characters within the range of characters [a-c] matches a, b or c

[^ any series of characters] Any character except ones after the ^ [^c3] matches any character except c or 3

? 0 or 1 of the previous character ba?t matches bat or bt, but not boat

* 0 or more of the previous character ba*t matches bt, bat, baat etc

+ 1 or more of the previous character ba+t matches bat, baat etc but not

Easy question, right?
Mingwei Jiang
Ranch Hand

Joined: Feb 19, 2004
Posts: 63
I think just keep your solution as simple as possible will do the thing as it is stated in my instructions though mine is not Urlybird.
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232

I have also Urlybird to implement.

I search only for letters. So no wild characters and other stuff. If there is '?' then the matching attribute values has to have that character.

----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Maurizio Nagni
Ranch Hand

Joined: May 29, 2004
Posts: 75
yes.... do not use magic.... suppose you like music.. and suppose you have money to invest and you want to call your hotel "therapy?" ok..ok... more serious.... flexible mean that you can expand later, add filter for data or add some features from the user, but not do them.... just be flexble but do not implement them... just be as simple as possible
Michael Vargenstien
Ranch Hand

Joined: Jan 27, 2007
Posts: 61
Thanks for the input guys. Your right, I think I'm over complicating. When in doubt: K.I.S.S.
I agree. Here's the link:
subject: UrlyByrd: wild characters and search question
jQuery in Action, 3rd edition