Home

[May 14, 2008]

Austria India Tour Packages

Filed under: School of Travel — @ 2:27 pm

AUSTRIA

Country Info

Austria is located in the high Alps , alongside the Danube Valley . It is one of the most scenic countries of the world. Previously being the part of the Austro-Hungarian Empire, this picturesque country dates back to the end of World War I (1918). The architectural beauty of Vienna , the art and year-round musical festivals of Salzburg draw tourists from all over the world.

Austria tours typically include a stop in Vienna, where you might see the State Opera House, the Jewish quarter, Heldenplatz and St. Stephen’s Cathedral. Salzburg, another popular stop for Austria vacation packages, is Mozart’s birthplace and the site of the impressive Domplatz and the lush Mirabell Gardens, a true horticultural asterpiece. Many Austrian tours stop in Melk for a visit to the Melk Abbey and a glimpse of picturesque Salzkammergut Lakeland

Austria offers numerous outdoor activities for tourists. Conquer the mountain ranges through mountain tours. The Alps cover half of the country making the alpine weather predominant, but in the East it receives scanty rainfall in comparison with the Western alpine.

Major Cities

Vienna : Austria ’s capital city Vienna has a whole lot of tourist attractions. There are more than 50 museums open to the public, including the Natural History Museum , the Austrian Museum of Applied Arts, the Museum of the 20th Century, the Museum of Modern Art , the Knstlerhaus, the Clock and Watch Museum and the Technology Museum . St Stephen’s Cathedral, the art collection at the Belvedere Palace , the Chapel of the Hofburg, the Parliament, the Rathskeller (Town Hall), the University and the Votive church along the Ringstrasse are the few added attractions. Don’t miss the New Year concerts having lavish balls in Vienna followed with February’s Fasching(Carnival)

Salzburg : The going can never get any better than Austria , for all the lovers of arts. Salzburg is the most elegant city set against a backdrop of breathtaking mountain scenery. Austria is home to a marvelous culture, with its classical music festivals in Vienna , Salzburg and Bregenz. The Salzburg International Festival takes place in late-July and August and includes plenty of music by the city’s favourite son, Mozart.

Innsbruck : Austria ’s town Innsbruck is the centre of internationally renowned ski complex having six major resorts. Innsbruck is the ancient and an 800-year-old town having number of popular buildings dating from Austria ’s cultural Renaissance in the 16th-18th centuries, and a 12th-century castle

Tourist Attractions

The Hofburg Palace - it is also known as the Imperial Palace . The palace is grand in its architecture. You can also witness here a performance of the Vienna Boys’ Choir at the Imperial Court Chapel section. Look out here for the Imperial jewels of the royalty at the Liturgical and secular treasury.

St. Stephen’s Cathedral The St Stephen’s Cathedral is a beautifully designed building, a marvellous example showcasing the Gothic architecture. The tower is visible from many parts of the city. It has been a target of may attacks, yet it has survived the tests of time. Te cathedral’s roof has been designed in an unusual zigzag pattern.

Schonbrunn - this is the summer palace of the Hapsburgs. The palace has one of the finest gardens, built in 1752, which also makes it the oldest surviving zoological Garden. The magnificence of this palace often draws comparisons with the palace at Versailles . Have a look at the fine porcelains and witness the royal splendor at the tours of apartment.

Sandy Kathuria

Austria India Tour Packages

Introduction To Regular Expressions In PHP

Filed under: WWW — @ 12:27 pm

In Linux and Unix, the syntax that is commonly used by many applications for specifying text patterns is known as regular expressions or in short form - regex. Regex is a very powerful technique to describe patterns and many programs use them to describe sequences of characters to be matched. Search programs such as ‘grep’ rely heavily on regex. Basically regex forms the core in the linux world. Many scripting languages such as perl, ruby, php…etc has build in regex functions as well. So you can see, learning regular expression is important because they are used alot in many places and probably more so in the future.

Regex can be scary at first but if you can get the basics, it is really not too hard to understand. In this article, we are going to look at how regex comes into the picture when writing php applications.

To do a quick summary so far, a regular expression is a sequence of literal characters, wildcards, modifiers and anchors.

Literal Characters

Literal characters are letters, digits and special characters that match only themselves. Examples are abc, 123, ~@ and so on (some characters are reserved though).

- An inclusion range [m-n] matches one of any character included in the range from m to n.

Example ‘[a-z]’ will match any alpha character that falls within the a to z range.

- An exclusion range [^m-n] matches one of any character not included in the range from m to n. Example ‘[^0-9]’ will match any non-digit character.

- A period “.” matches any character. It is also known as the wildcard. Example ‘a.c’ will match ‘aec’, ‘acc’, ‘a@a’ and so on.

- The escape character ” enable interpretation of special characters. Example ‘a.c’ will match ‘ac’ only. Remember that ‘.’ is a reserved character to represent a wildcard? Therefore to match a period, ie ‘.’, we need to escape it like so ‘.’

- The expression [:alnum:] will match all alpha-numeric characters. It is a shortcut to [A-Za-z0-9]. As you can see, it is not really a shortcut. The expression [:alnum:] might be easier to remember for some people.

- The expression [:alpha:] will match all alpha characters. It is a shortcut to [A-Za-z].

- The expression [:blank:] will match a space or tab.

- The expression [:digit:] will match a numeric digit. It is a shortcut to [0-9].

- The expression [:lower:] will match all lowercase letters. It is a shortcut to [a-z].

- The expression [:upper:] will match all uppercase letters. It is a shortcut to [A-Z].

- The expression [:punct:] will match all printable characters, excluding spaces and alphanumerics.

- The expression [:space:] will match a whitespace character.

Modifiers

A modifier alters the meaning of the immediately preceding pattern character.

- An asterisk (’*') matches 0 or more of the preceding term. Example ‘a*’ will match ”, ‘a’, ‘aa’, ‘aaaaa’ and so on (Note the use of ”. It simply means that the expression matches nothing as well).

- A question mark (’?') matches 0 or 1 of the preceding term. Example ‘a?’ will match ” and ‘a’ only.

- A plus sign (’+') matches 1 or more of the preceding term. Example ‘a+’ will match ‘a’, ‘aaaaaaa’ and so on. It will not match ”.

- {m,n} matches between m and n occurences of the preceding term. Example ‘a{1,3}’ will match ‘a’, ‘aa’ and ‘aaa’ only.

- {n} matches exactly n occurences of the preceding term. Example ‘a{2}’ will match ‘aa’ only.

Anchors

Anchors establish the context for the pattern such as “the beginning of a word” or “end of word”.

- The pike ‘^’ marks the beginning of a line. Example ‘^http’ will match any new line that starts with ‘http’.

- The dollar sign ‘$’ marks the end of a line. Example ‘after$’ will match any line that ends with ‘after’. (Variables in php starts with $. Try not to confuse with it).

Grouping

Grouping ‘( )’ allows modifiers to apply to groups of regex specifiers instead of only the immediately proceding specifier. Example ‘( aa | bb )’ will match either ‘aa’ or ‘bb’

Enough of boring stuff, it is time to put what the theory of regex into good use.

PHP Implementation

There are 2 main variants of regex, Perl-compatible regex (PCRE) and POSIX-Extended. PHP offers quite alot of functions to implement these 2 types of regex. In PHP, the most commonly used PCRE function is ‘preg_match’ and in POSIX-extended regex, ‘ereg’. Both syntax are slightly different but equally powerful. The preference to use ‘preg_match’ or ‘ereg’ is entirely up to individual although Zend suggested that preg_match is slightly faster. I prefer to use ‘eregi’ simply because of my background in linux administration.

Example 1: Matching United States 5 or 9 digit zip codes

Zip codes in USA have the following format ##### or #####-#### where # is a digit. If you want to verify the zip code submitted say from an online form, you will need to use regex somewhere in your script to verify it. The matching POSIX-extended regex pattern will be:

[[:digit:]]{5}(-[[:digit:]]{4})?

Confused? Wait, let me explain why. This regex is split up into 2 parts: [[:digit:]]{5} and (-[[:digit:]]{4})?.

First Part: ‘[[:digit:]]’ means the digit range and {5} means that the digit must occur 5 times.

Second Part: The bracket ‘( )’ groups the ‘-[[:digit:]]{4}’ together and the ‘?’ means the expression ‘(-[[:digit:]]{4})’ can either occur 0 or 1 time.

To implement the regex in PHP, we use the following code:

$zipCodes = ‘xxxxx-xxxx’;

$pattern = ‘[[:digit:]]{5}(-[[:digit:]]{4})?’;

if (ereg($pattern,$zipCodes)) {

echo “matched found “;

}

else {

echo “match not found”;

}

Example 2: Matching Dates

Say we want to verify the dates entered by the user. If we only accept dates like “YYYY-MM-DD” or “YYYY-M-D”, the regex pattern will be

[0-9]{4}(-[0-9]{1,2})+

The ‘+’ behind the term (-[0-9]{1,2}) means that the term must occur at least once. Note that I can also rewrite the regex as:

[[:digit:]]{4}(-[[:digit:]]{1,2})+

or

[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}

As you can see, there can be many solutions to a problem…

Conclusion

Regex may be hard to digest at first but the logic is simple if you are able to practice more. Learning regex is as important as learning PHP. More examples can be seen at web-developer.sitecritic.net. Good luck.

Bernard Peh is a great passioner of web technologies and one of the co-founders of Sitecritic.net Site Reviews. He works with experienced web designers and developers for more than 5 years, developing and designing commercial and non-commercial websites. During his free time, he does website reviews, freelance SEO and PHP work. Visit his blog at Melbourne PHP


RSS