{"id":30097,"date":"2024-11-12T12:39:24","date_gmt":"2024-11-12T12:39:24","guid":{"rendered":"https:\/\/www.seobility.net\/en\/blog\/wiki\/syntax\/"},"modified":"2025-02-26T13:11:46","modified_gmt":"2025-02-26T13:11:46","slug":"Syntax","status":"publish","type":"wiki","link":"https:\/\/www.seobility.net\/en\/wiki\/Syntax","title":{"rendered":"Syntax"},"content":{"rendered":"<h2><span class=\"mw-headline\" id=\"Definition\">Definition<\/span><\/h2>\n<p>Syntax can be considered as a form of computer grammar. In order to interpret information and understand intent, whether it be delivering a website or search results, syntax is used to provide an information structure that computers can use to understand it. Sometimes, this syntax is very loose, such as in search queries. Here, a computer will attempt to interpret information regardless of how it is entered. In other situations, such as computer code, syntax is very rigid and deviations may result in a computer program either running incorrectly, or not running at all.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Syntax_in_programming\">Syntax in programming<\/span><\/h2>\n<p>Programming syntax refers to the structure of how code is written and formatted in a particular language. There are very many programming languages, and each may either have its own syntax, or borrow heavily from an existing syntax. As a program can be written in one of many different ways, it is not possible to list syntax for all programming languages. Instead, some of the more common ones have been chosen below.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"C_and_C-like_syntax\">C and C-like syntax<\/span><\/h3>\n<p>C was a foundational programming language and has influenced many other programming languages that followed in various ways, including copying its syntax. Modern languages that have adopted code conventions and syntax from it include C++, PHP, and Java.\n<\/p>\n<p>Computer code written in a C-like programming language will typically end declarations and function calls with a semi-colon <code>;<\/code>, wrap code blocks like functions and classes in curly brackets <code>{}<\/code> and comments are written by either appending <code>\/\/<\/code> characters to a line, or wrapping comments in <code>\/* *\/<\/code>.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Python\">Python<\/span><\/h3>\n<p>Python has a somewhat unique syntax, in that is eschews a lot of code conventions. Rather than using any of the special characters as in C-like syntax, Python uses line breaks and indentation. A code block is defined by indenting the code below where it is declared, and line breaks indicate the end of program calls and declarations.\n<\/p>\n<h3><span class=\"mw-headline\" id=\"Lisp\">Lisp<\/span><\/h3>\n<p>Lisp also has a very unique syntax, wrapping almost every statement or expression in brackets (). Unlike many other languages, brackets are very often nested and used to clearly separate things like function declarations, function arguments and function calls.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Syntax_of_a_URL\">Syntax of a URL<\/span><\/h2>\n<p>URLs follow a loosely defined syntax, but there is variation depending on the program or protocol being invoked and how the code to interpret it is written.\n<\/p>\n<p>The first part of a URL is the protocol. For web addresses, this is typically either <code>https:\/\/<\/code> or <code>https:\/\/<\/code>, but there are other protocols, including <code>ftp:\/\/<\/code> and <code>gopher:\/\/<\/code>.\n<\/p>\n<p>The second part of a URL is called the domain name, which might be preceded by www. and is followed by a TLD (top-level domain), such as .com, .org, or .net. Subdomains may exist, which precede the domain name and are followed by a full stop, using a syntax such as: <code>subdomain.domain.TLD<\/code>\n<\/p>\n<p>This is the extent of what is required for a valid URL, but there may be more. It depends on the program and the code used. After a \/ character, a file path or string of arguments may appear. This could look something like: <code>domain.TLD\/images\/imagename.png<\/code> or <code>domain.TLD\/?page=contact&amp;customerID=123<\/code>\n<\/p>\n<p>A file path will link a user to a specific file on the server. A string of characters typically represents information that is passed between pages and used somewhere on the page itself.\n<\/p>\n<p>Another optional element is the fragment identifier, located at the end of a URL. The fragment identifier starts with a <code>#<\/code> and refers to a point within a web page so that it can be accessed directly.\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Google_Search_syntax\">Google Search syntax<\/span><\/h2>\n<p>Google uses the power of its computer infrastructure to interpret search queries however they are entered. However, there is a syntax to Google searches that can help you fine-tune search queries and deliver more specific results. An example of some of the different search options is listed below.\n<\/p>\n<p>Google can search for information on a specific website by appending a search query with site:domain. For example, <code>site:spotify.com The Beatles<\/code> would search for The Beatles only on Spotify.\n<\/p>\n<p>There are many other options that work in the same way and are largely self-explanatory. These include\n<\/p>\n<pre>\r\nfiletype: \r\nrelated:\r\nintitle:\r\ninurl:\r\nweather:\r\nstocks:\r\nmovie:\r\nmap: \r\n<\/pre>\n<p>and more. These are all used to narrow down search results and refine queries, as without this information, a computer must interpret ambiguous statements and guess at search intent. As more information is provided, the computer can use it to deliver higher quality, more relevant results.\n<\/p>\n<p>Google search queries also accept several <a href=\"\/en\/wiki\/Boolean_Operators\" title=\"Boolean Operators\">Boolean operators<\/a>. These generally enable you to include or exclude certain information, sometimes in tangent with other information. For example, &#8216;AND&#8217; and &#8216;OR&#8217; can be used between separate words or phrases to only return results that either contain both, or at least one statement, respectively.\n<\/p>\n<p>A search query wrapped in double quotations <code>\"\"<\/code> will conduct an exact search for the phrase placed inside the brackets. Double periods <code>..<\/code> can be used between numbers to act as a range search operator. All of these Boolean operators can be used together in a single search query. A search for results from both The Beatles and common nicknames between specific years, could look like: <code>(\"The Beatles\" AND \"Fab Four\") 1965..1969<\/code>\n<\/p>\n<h2><span class=\"mw-headline\" id=\"Similar_articles\">Similar articles<\/span><\/h2>\n<ul>\n<li> <a href=\"\/en\/wiki\/HTML5\" title=\"HTML5\">HTML5<\/a><\/li>\n<\/ul>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Article\",\n  \"author\": {\n    \"@type\": \"Organization\",\n    \"name\": \"Seobility\",\n    \"url\": \"https:\/\/www.seobility.net\/\"\n  }\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Definition Syntax can be considered as a form of computer grammar. In order to interpret information and understand intent, whether it be delivering a website or search results, syntax is used to provide an information structure that computers can use to understand it. Sometimes, this syntax is very loose, such as in search queries. Here, [&hellip;]<\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-30097","wiki","type-wiki","status-publish","hentry","wiki_categories-web-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Syntax explained - Seobility Wiki&lt;<\/title>\n<meta name=\"description\" content=\"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.seobility.net\/en\/wiki\/Syntax\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Syntax explained - Seobility Wiki&lt;\" \/>\n<meta property=\"og:description\" content=\"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.seobility.net\/en\/wiki\/Syntax\" \/>\n<meta property=\"og:site_name\" content=\"Seobility\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/seobility.net\/\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-26T13:11:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/seobility-og-image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@seobility_net\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"ScholarlyArticle\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax\"},\"author\":{\"name\":\"Seobility Wiki Team\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#\\\/schema\\\/person\\\/c838e66a3b46262b4c963df5cd5b2d8a\"},\"headline\":\"Syntax\",\"datePublished\":\"2024-11-12T12:39:24+00:00\",\"dateModified\":\"2025-02-26T13:11:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax\"},\"wordCount\":832,\"commentCount\":0,\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax\",\"name\":\"Syntax explained - Seobility Wiki&lt;\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#website\"},\"datePublished\":\"2024-11-12T12:39:24+00:00\",\"dateModified\":\"2025-02-26T13:11:46+00:00\",\"description\":\"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\\\/Syntax#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Wiki\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wiki\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Syntax\",\"item\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/wp-json\\\/wp\\\/v2\\\/wiki\\\/30097\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/\",\"name\":\"Seobility\",\"description\":\"Online SEO Software &amp; Tools For Better Rankings\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/#\\\/schema\\\/person\\\/c838e66a3b46262b4c963df5cd5b2d8a\",\"name\":\"Seobility Wiki Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"contentUrl\":\"https:\\\/\\\/www.seobility.net\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/Seobility-S-2025-150x150.png\",\"caption\":\"Seobility Wiki Team\"},\"description\":\"The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about the people behind the Seobility Wiki.\",\"url\":\"https:\\\/\\\/www.seobility.net\\\/en\\\/blog\\\/author\\\/seobility-wiki-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Syntax explained - Seobility Wiki&lt;","description":"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.seobility.net\/en\/wiki\/Syntax","og_locale":"en_US","og_type":"article","og_title":"Syntax explained - Seobility Wiki&lt;","og_description":"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...","og_url":"https:\/\/www.seobility.net\/en\/wiki\/Syntax","og_site_name":"Seobility","article_publisher":"https:\/\/www.facebook.com\/seobility.net\/","article_modified_time":"2025-02-26T13:11:46+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/seobility-og-image.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@seobility_net","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"ScholarlyArticle","@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax#article","isPartOf":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax"},"author":{"name":"Seobility Wiki Team","@id":"https:\/\/www.seobility.net\/en\/#\/schema\/person\/c838e66a3b46262b4c963df5cd5b2d8a"},"headline":"Syntax","datePublished":"2024-11-12T12:39:24+00:00","dateModified":"2025-02-26T13:11:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax"},"wordCount":832,"commentCount":0,"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.seobility.net\/en\/wiki\/Syntax#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax","url":"https:\/\/www.seobility.net\/en\/wiki\/Syntax","name":"Syntax explained - Seobility Wiki&lt;","isPartOf":{"@id":"https:\/\/www.seobility.net\/en\/#website"},"datePublished":"2024-11-12T12:39:24+00:00","dateModified":"2025-02-26T13:11:46+00:00","description":"Syntax can be considered as a form of computer grammar and is used to provide an information structure for computers to understand intent. Learn more ...","breadcrumb":{"@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.seobility.net\/en\/wiki\/Syntax"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.seobility.net\/en\/wiki\/Syntax#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.seobility.net\/en\/"},{"@type":"ListItem","position":2,"name":"Wiki","item":"https:\/\/www.seobility.net\/en\/wiki"},{"@type":"ListItem","position":3,"name":"Syntax","item":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30097"}]},{"@type":"WebSite","@id":"https:\/\/www.seobility.net\/en\/#website","url":"https:\/\/www.seobility.net\/en\/","name":"Seobility","description":"Online SEO Software &amp; Tools For Better Rankings","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.seobility.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.seobility.net\/en\/#\/schema\/person\/c838e66a3b46262b4c963df5cd5b2d8a","name":"Seobility Wiki Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","url":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","contentUrl":"https:\/\/www.seobility.net\/wp-content\/uploads\/2025\/06\/Seobility-S-2025-150x150.png","caption":"Seobility Wiki Team"},"description":"The Seobility Wiki team consists of seasoned SEOs, digital marketing professionals, and business experts with combined hands-on experience in SEO, online marketing and web development. All our articles went through a multi-level editorial process to provide you with the best possible quality and truly helpful information. Learn more about the people behind the Seobility Wiki.","url":"https:\/\/www.seobility.net\/en\/blog\/author\/seobility-wiki-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki"}],"about":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/types\/wiki"}],"author":[{"embeddable":true,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/comments?post=30097"}],"version-history":[{"count":0,"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/wiki\/30097\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.seobility.net\/en\/wp-json\/wp\/v2\/media?parent=30097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}