Questions tagged [curly-brackets]

The symbols "{" and "}", commonly used in programming languages. Please use this tag only if the specific usage of these symbols is a relevant part of the question.

The curly brackets (or braces) "{" and "}" are special cases of brackets, along with parentheses and square brackets ("[" and "]").

Curly brackets have many uses in most programming languages, such as:

  • identify code blocks;
  • create lists and arrays;
  • pass arguments to commands in TeX.
82 questions
1
vote
2 answers

Python 3.4 - Regular Expressions - Matching Innermost curly brackets within & not within other brackets

In Python 3.4, I am trying to use two different regular expressions for matching two types of innermost curly brackets, i.e. curly brackets which do not contain any other curly brackets. Regular Expression 1) Match innermost curly brackets which are…
martin_0004
  • 357
  • 1
  • 2
  • 15
1
vote
1 answer

Dynamic meta tag with angularJS

I got a problem in using AngularJS for dymamic meta tag. The data can't bind when js is still not work so both Google and Facebook can't reconigze true page title and description. Is there anyone can help me please.
1
vote
1 answer

Regular Expression - Get text between double curly brackets and avoid escaped curly brackets

I have been working in an AutoIt program which is supposed to receive variables declared into a .ini file. Later those variables can can called using double curly brackets "{{}}" and single curly brackets "{}". Here is an example. Variable is…
Aeolis
  • 43
  • 1
  • 7
1
vote
3 answers

Regex Match.Value returning entire value, not the matched groups

I am currently trying to achieve the relatively simple task of capturing values from a string which exist between sets of curly braces using a regular expression. The expression I have written works fine on a number of online tools I have tested it…
Scott Hulme
  • 124
  • 1
  • 8
1
vote
3 answers

Custom Curly Bracket Methods

In java some standard library methods (Maybe they're not actually methods?) have the following format: keyword(condition or statements) { //write your code here } This includes the if-statement, for-loop, while-loop do-while-loop…
Dziugas
  • 1,500
  • 1
  • 12
  • 28
1
vote
0 answers

Initializing a reference with curly braces vs parentheses

I came across an issue which surprised me. I though that int i = 3; int i {3}; int i (3); were equivalent. This lead me to do (please note the t {t_} in the constructor) for the following class (exampel from Anthony Williams book C++ Concurrency in…
jensa
  • 2,792
  • 2
  • 21
  • 36
1
vote
3 answers

Match text between nested brackets with RegEx in Python

I have a large CSV file in which a line looks like the one below: id_85, { "link": "some link", "icon": "hello.gif", "name": "Wall Photos", "comments": { "count": 0 }, "updated_time": "2012-03-12", "object_id":…
pravi
  • 2,029
  • 3
  • 13
  • 9
1
vote
0 answers

eclipse: source hover for java when hovering over closing bracket: code color

When hovering over a closing bracket, its block/scope is highlighted in blue color, if within scope of the screen. The color of the code(variables, constants, comments etc) stays the same. When I change the color theme, however, the block is…
Nick Zafiridis
  • 146
  • 1
  • 13
1
vote
5 answers

PHP: Replace certain parts of string with array values

I want to replace values in a string if a particular string exists in an array. $str = 'My name is {{name}}. I live in {{city}}. I love to {{hobby}}. {{ops...}}'; $array = array( 'name' => '010 Pixel', 'city' => 'USA', 'hobby' =>…
010 Pixel
  • 195
  • 3
  • 14
1
vote
1 answer

Curly brackets when using clipboard_append

So I was writing a program that converts MM to inches, RA surface finishes to MM, and can also convert tolerances for dimensions from MM to inches. This is actually my first project I took on in python and I have only been learning to code for about…
Inhale.Py
  • 260
  • 1
  • 5
  • 15
1
vote
1 answer

Powershell curly braces and variables not being parsed

I'm trying to bulk update a large amount of distribution lists using powershell, I've written this so far: foreach ($Item in @(Import-Csv -Path "ranks.csv")) { $Rank = $Item.Rank Set-DynamicDistributionGroup -Identity "$Rank" -DisplayName "$Rank…
henrycarteruk
  • 12,708
  • 2
  • 36
  • 40
1
vote
3 answers

Sperate PHP include files - opening and closing brackets/braces { } for if's and while loop nd closing curly brackets/braces in between files

I am working with PHP includes i.e: include_once("somephpfile.php"); And a CSS/HTML designer that is very problematic. I am trying to keep all PHP away from the designer, as they become very panicked : \ and they create many problems, deleting…
user1502852
1
vote
4 answers

Are there any drawbacks to using cascading "else if" statements?

This question pertains to pretty much all C-like "curly bracket" programming languages. I'm talking about using the following: if(condition) meh(); else if(condition1) bleh(); else if(condition2) moo(); else foo(); Are there any…
BenW
  • 489
  • 3
  • 8
1
vote
1 answer

How to tell Eclipse to stop moving my curly brace backwards

I recently installed Eclipse (Helios Release) PDT and am trying to set the preferences to my project's style of code formatting. I have gone into... Eclipse PDT > Window > Preferences > PHP > Editor > Typing ...and unchecked all options. I have also…
JW.
  • 4,821
  • 5
  • 43
  • 60
0
votes
2 answers

Smarty regex_replace matching expression with curly brackets

Can anyone please help me with this...I'm not very good with regular expressions and I'm banging my head since days! In Smarty I have this array o values included in curly brackets captured in variable $str: {capture assign=str}{literal} {label1:…
Tron
  • 11
  • 1
  • 4