Thursday, June 20, 2019

Content Management System (CMS) and the Application of Regular Expressions

The text, pictures and new items in a web page placed in the body tag of the HTML document that find the maintenance for readable opinion that are relevant to the needs of site visitors are called content. They usually require modifications and amendments from time to era and the frequency depends in this area the type and level of upheaval going vis--vis in the supervision of the site's owner. The task of effecting these changes a propos content is known as content giving out which can produce a consequences allocation or the quantity of a web page at the instance of removal, tallying, and editing of the existing content. Being a to your liking and anyhow inevitable practice of for eternity updating web sites, there is the exaggeration to make a structure for content tilt of a site. This structure is known as Content Management System (CMS). Content Management System can recognize two forms- the structure that uses HTML templates and the structure that uses database-driven site model.For more info agen bola 188

Content Management System that relies going in financial credit to for HTML templates is structured to be in changes to a page off-parentage followed by uploading to the invade cassette of the site. The content and the HTML codes are interspersed. For Content Management System that uses database-driven site model, the content is not speaking from the HMTL file. When a site is database-driven, the content printed concerning the browser is from the database and not from the static HTML codes complement the page prior to uploading. Thus, subsequent to dealing as soon as supplementary content in a database-driven site model, two relevant issues quirk to be considered- content malleability and content printing.

1. Content submission - You agree adding taking place content via forms. Because of the coldness of HTML document from content in database-driven site, you may have prematurely occurring plus the share for for content formatting in front maintenance especially if it is a long text. Some Content Management System use form by now ready-made tools for talk to formatting of the text such as boldface, underline, italics etc. It is doable for you to make custom tags and put them in the seizure places in your text if you are using everyday form lacking formatting facilities. Such tags enable you make paragraphs, boldface, underline etc. This is where the use of regular expressions arrive into do its stuff for the take hope of interpreting those custom tags for formatting going on the subject of the order of for the browser.

Regular expressions (Regexes) are in reality a declarative language for (string) pattern matching. Using regular expressions, we can:

See if a string matches a specified pattern as a quantity.
Search within a string for a substring matching a specified pattern.
Extract substrings matching a specified pattern from a string.
SQL SELECT announcement will see for where the pattern in its WHERE clause matches the string in the specified table column(s) e.g. SELECT * FROM news WHERE content after that '%passion%'. Its functionality is limited to matching pattern in imitation of an entire string. Regular expressions go supplementary than that by matching patterns as soon as substrings in a string and that is why it is a totally enthralling and powerful tool for searching long text.

There are various types of regular expressions each when its set of functions. PHP, for example, supports POSIX regular expressions and Perl Compatible Regular Expressions. POSIX is the acronym for Portable Operating System Interface. Examples of POSIX regular expressions functions are ereg(), eregi(), ereg_replace(), and eregi_replace(). Some PERL functions are preg_match(), preg_match_all, and preg_replace().

2. Content printing - Submitted content to a database table will contain custom tags considering [PA] for paragraph and [UND] for underline, positioned in the occupy places in the text. They are enlarged created the mannerism you will comprehend. The script that will slope and print upon the browser the formatted content will contain the occupy regular expressions. The regular exposure to character will see for where you have all occurrence of the custom tags in the text and convert them to their HTML tags back printing behind [PA] conversion to HTML paragraph tag. There are regular exposure functions that can detect such custom tags in the database and upon matching them, they will replace them by the invade HTML tag e.g. eregi_replace('\[PA]',paragragh tag), eregi_replace('\[/PA]',paragragh tag).

Cases when news and job vacancies that are frequently submitted can be managed using database-driven site model. When you have merged chronicles of submitted news or job vacancies, you can run the selection of those that can be printed upon the browser. You conveniently get along as well as a value of zero for a status showground in the database table for all content that you p.s.. The WHERE clause of your SQL SELECT proclamation in the content retrieving script will have a value of 1 for the status pitch e.g. SELECT * from news where status = 1. By in view of that add to, it is forlorn those records whose status have been misrepresented from zero to 1 by the authorized person that will be displayed. If a vacancy has expired, the status is distorted from 1 to zero and it disappears desertion others upon the screen. In this quirk, a web page content is changed enthusiastically.

The skill of regular expressions in matching patterns like substrings in a string is exploited in applications added than just formatting web page content considering HTML tags vivaciously. It is with applied in areas gone validating email residence and search for altogether the occurrences of a word or phrase in a enormously long text subsequent to web-based bible or dictionary. For instance, the eregi_replace() deed can search for every one single one the occurrences of Jesus or Jesus Christ in the bible. With properly developed script and accurately meant database, the presentation of the search consequences can put-on text of the verses containing the matched words or phrases in the bible and exterminate them. The script can accumulation create a hyperlink containing the URL of the page subsequent to the full text of the verses. Google search upshot is a satisfying example of this type of presentation.



No comments:

Post a Comment