+ Reply to Thread
Results 1 to 2 of 2

Thread: Validate Class in java

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    12

    Validate Class in java

    I have some of strings like :
    Code:
    [~class:obj]
    [~class|class2|more classes:obj]
    [!class:obj]
    [!class|class2|more classes:obj]
    [?method:class]
    And i want a REGEX Pattern that extract what is inside the [] and notice that there are
    "|" as a seperators between classes.

  2. #2
    Pattern could be :
    Code:
    /\[(\~|\!|\?)?(?:((?:[^:\]]*?)+):)?([^\]]+?)\]/
    OR
    Code:
    /[(.*?)(?:\|(.*?))*]/
    Hope that it helps.

+ Reply to 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