Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Select everything between curly brackets

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23988
    ysamjo
    Member

    I want to match any code that is between two curly brackets.

    lorem ipsum {loriipsu} lorem ipsum…

    I’ve got no further markup.
    I think it has to be done with :before and :after but I don’t get it yet.

    #53257
    Mr KiTT3N
    Member

    Within what languages are you using jquery? is this a form submission (php)? or you looking straight up xhtml/css?

    #53291
    frujo
    Member

    I think you need to read more about regular expressions. Then create pattern of selecting the inner content of braces. If we talk about JavaScript it will look like:

    Code:




    Untitled Document





    In a sample above /{[^}]+}/ is a pattern that selects everything inside of curly braces. g is activating the returning of array of found matches. Without it only the first match will be returned.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.