SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member iam@denizkumsal.'s Avatar
    Join Date
    Nov 2004
    Location
    Toronto
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Extract absolute path operation from SVG data value

    I have the following d attribute for SVG but the question is about regular expression :

    M772.333,347.86c0,2.284-1.652,4.14-3.689,4.14h-52.622c-2.038,0-3.69-1.854-3.69-4.14V296.139c0-2.286,15.652-1.14,17.69-1.14l-0.189-3h38.81c2.039,0-0.31,4.854-0.31,7.14L772.333,347.86z

    I'm looking for a way to get the blocks that has capital and a series of number so the result array should be [M772.333,347.86, V296.139, L772.333,347.86]

    The pattern [A-Z]?[0-9.,] gives capitals and the numbers next to it but as well as the numbers after lowercase letters. I'd like to get rid of the numbers after lowercase letters.

    Thank you,

  2. #2
    SitePoint Member iam@denizkumsal.'s Avatar
    Join Date
    Nov 2004
    Location
    Toronto
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a solution to my question.

    (?![0-9,-.])[A-Z]?[0-9.,]+ is the pattern that finds the required capital and number groups.

  3. #3
    SitePoint Member iam@denizkumsal.'s Avatar
    Join Date
    Nov 2004
    Location
    Toronto
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a simpler and yet elegant method : [A-Z][0-9.,]+


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •