locked
Java Regular Expression. RRS feed

  • Question

  • I have a document on which i need to extract some information using regular expression. The information needs to be extracted is  "Yogi:   123 − 1456". If i created an expression like

    (?i)Yogi<filler1><Label=DocumentNumber>(<anynumber>) or

    (?i)Yogi<filler1><Label=DocumentNumber>([\d- ]{3,}).. Both expressions doesn't work because the character "−" is a special character. If i just copy paste this sign it works. but when i save my file as xml and try to open this "−" sign automatically converted as "?". Kindly let me know if any one of you have solution for this.

    • Moved by litdev Thursday, July 10, 2014 9:24 AM
    Thursday, July 10, 2014 5:20 AM

Answers

  • You better ask this in a Java forum. This forum is about the Small Basic programming language.

    Jan [ WhTurner ] The Netherlands

    • Proposed as answer by Dave PatrickMVP Thursday, July 10, 2014 10:14 AM
    • Marked as answer by Just Karl Thursday, July 17, 2014 8:46 PM
    Thursday, July 10, 2014 7:48 AM