libgnu-regexp-java-1.1.4/0042755000175000000620000000000007621225062014356 5ustar killerstafflibgnu-regexp-java-1.1.4/COPYING.LIB0100644000175000000620000006347607240421273016030 0ustar killerstaff GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libgnu-regexp-java-1.1.4/COPYING0100644000175000000620000004310506670624075015421 0ustar killerstaff GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libgnu-regexp-java-1.1.4/README0100644000175000000620000000611707364636621015251 0ustar killerstaffgnu.regexp README ----------------- This is open source software distributed under the terms of the GNU Lesser General Public License. See the COPYING.LIB file for details. Some included utilities are distributed under the terms of the GNU General Public License, a copy of which is included in the file COPYING. INSTALLING Copy the gnu.regexp jar file (located in the 'lib' directory) to your usual installation directory for Java archives. To use gnu.regexp, you will need to include it in your classpath setting. Typically this is done by adding an entry to your CLASSPATH variable setting with the full path to the JAR file, e.g. csh: % setenv CLASSPATH ${CLASSPATH}:/usr/java/lib/gnu-regexp-1.1.x.jar bash: % export CLASSPATH=${CLASSPATH}:/usr/java/lib/gnu-regexp-1.1.x.jar DOS: > set CLASSPATH %CLASSPATH%;C:\Java\lib\gnu-regexp-1.1.x.jar Various shells and operating systems may have slightly different methods. Consult your Java virtual machine documentation for details. You may also specify the -classpath option to the java executable, e.g. compile: % javac -classpath /usr/java/lib/gnu-regexp-1.1.x.jar MyClass.java execute: % java -classpath /usr/java/lib/gnu-regexp-1.1.x.jar MyClass DOCUMENTATION HTML documentation is provided in the 'docs' directory. This is basically a snapshot of the official gnu.regexp web site (see below for URL). The documentation files are: docs/index.html -- general package information docs/changes.html -- change history docs/credits.html -- credits and contributors docs/faq.html -- frequently asked questions docs/syntax.html -- supported/unsupported syntax and usage notes docs/reapplet.html -- demo applet HTML wrapper docs/api/*.html -- javadoc generated info For additional help, you can try emailing . UTILITIES gnu.regexp comes with a number of simple utility programs intended to test and demonstrate its features. These are not compiled into the Java archive file, but can be found in the 'src/gnu/regexp/util' directory. To run the Grep and Egrep programs, you'll need to install the gnu.getopt package, available at http://www.urbanophile.com/~arenn/hacking/download.html, and put those class files in your classpath as well. HACKING You are free to fold, spindle, mutilate and modify this library, provided you follow the terms outlined in COPYING.LIB. The gnu.regexp project team gratefully accepts any bug fixes or enhancements you may come up with (see the TODO file if you're in need of some ideas). A few parameters at the top of the Makefile in the 'src' directory need to be edited to match your local system setup. BUG REPORTS Send bug reports to , or join the gnu.regexp mailing list by sending a "subscribe" message to . It helps if you can send a code sample showing the regular expression you were using and how you were using it. LATEST VERSION You can always obtain info about the latest version of gnu.regexp at http://www.cacas.org/java/gnu/regexp/. New versions are also announced on the regexp mailing list (see above). Thanks! Wes Biggs libgnu-regexp-java-1.1.4/TODO0100644000175000000620000000525207364636621015060 0ustar killerstaffgnu.regexp TODO --------------- These are items that have yet to be implemented or are part of the general wish list for gnu.regexp. You can contribute to this program and get your name permanently embedded in the distribution if you care to take on any of these tasks. See the contact info in the README. Bugs / Problems with the engine: Using a ')' in a character class which is within a () grouping triggers an REException while parsing. Workaround is to put a backslash in front of the literal ')'. The leftmost longest rule is not strictly adhered to. For example, the expression ".*?z?", given input "xyz", should match the whole string, not the empty string. Missing operators: [.symbol.] -- collating symbol (POSIX) [=class=] -- equivalence class (POSIX) I18n support: Some POSIX char classes ([:alpha:]) are locale sensitive, others need work Ranges (e.g. [a-z]) should be locale sensitive Should use collation elements, not chars, for things like Spanish "ll" REG_ICASE is not very friendly with Cyrillic and other locales. Messages used for exceptions should be localizable. Performance: Engine speed needs some major work. Miscellaneous/Requests for Enhancements: "Free software needs free manuals" -- you heard the man... Some features have been added to Perl between 5.0 and 5.6. Should the PERL5 syntax support these, or should a new syntax be added? Which should be the default? There could be a flag to enforce strict POSIX leftmost-longest matching. gnu.regexp.util.Tests should be fleshed out, or perhaps changed to use JUnit. It might make sense for getMatchEnumeration() to optionally return matches in reverse order, so that the indices were valid all the way through, even if you were doing text replacement on the way. Support J2ME CLDC limited APIs as optional target: Should be straightforward, but need to avoid use of REFilter(InputStream|Reader) classes, as well as all references to java.io.Serializable. RESyntax needs to replace java.util.BitSet with a home-grown version. Other than that, it should work. May want to package separately (e.g. gnu.regexp-1.0.8-j2me-cldc.jar). Add support for named subgroups: "(?P...)" (match) and "(?P=name)" (recall, like \n). Add the ability to get at an enumeration of names. Support associative-array style interface that allows users to define their own substitution behavior on matches. Perhaps a Substitutor interface with String substitute(REMatch match), and then RE.substituteAll(input, Substitutor) variations. Support excluded subrange syntax as in Unicode recommendations, e.g. "[a-z-[m-p]]" being a through z except for m through p. Add a split() method. Provide a build.xml file for Ant.libgnu-regexp-java-1.1.4/docs/0042755000175000000620000000000007617541044015314 5ustar killerstafflibgnu-regexp-java-1.1.4/docs/changes.html0100644000175000000620000003040207364636621017611 0ustar killerstaff package gnu.regexp - Regular Expressions for Java package gnu.regexp;
Change History

This page was last updated on 21 October 2001

1.1.4 (21 October 2001)
Patch to Makefile to include language resource files in the applet JAR. (Andrew G. Hammond)
Updates to gnu.regexp.util.Grep to add "-z" option, expand ZIP files. (Ulf Dittmer)
Some updates and clarifications to Javadoc, especially for substitute() methods. (Wes Biggs)
Fix to RE constructor for some uses of alternation operator failing due to minimumLength being set incorrectly. (Marcus Abels)
Added UncheckedRE subclass to provide constructors that are declared without exceptions (useful for static initializers). (Wes Biggs)
The getMatchEnumeration() methods that took an integer index offset resulted in REMatch objects with incorrect values for their start and end indices (the correct text was matched, but the values from getStartIndex() and getEndIndex() methods were incorrect). This has been fixed. (Wes Biggs)

1.1.3a (18 June 2001)
No code changes; distribution was missing a file.

1.1.3 (18 June 2001)
Change method signatures in REFilterReader to correctly override the Reader interface. Patch from Doug Seifert.
Fixed a bug in getMinimumLength() for expressions using alternation; because of this and the optimization introduced in 1.1.2, some matches were failing. (Wes Biggs)
Il8n support: all error messages are now stored in MessagesBundle.properties (Alan Moore)
Lookaheads, both positive and negative, are now supported, thanks to a patch from Shashank Bapat.
Parse intervals more in accordance with POSIX, i.e., if they don't exactly match one of {n}, {n,}, or {n,m}, the characters are matched literally. (Alan Moore)
Throw more exceptions when quantifiers (?, *, +, {}) appear in places where they are invalid, e.g., after a zero-width assertion (word boundary, lookahead), or after another quantifier. (Alan Moore)
Fixed two instances where incomplete patterns would cause ArrayIndexOutOfBoundsExceptions instead of REExceptions. (Alan Moore)
ASCII escapes \n, \r, and \t in [] lists are now supported. (Alan Moore)

1.1.2 (11 April 2001)
Fix REMatchEnumeration handling zero-length matches.
Declare classes "final" as much as possible, for speed.
Optimize match loop by checking remaining buffer against minimum length.
Fix '\b' and '\<' support to work correctly if before any consuming operators in the RE. Thanks to Alan Moore for identifying the problem and a fix.
Correct support for '^' in multiline match mode when used with an InputStream or Reader. Thanks to James Flynn for his suggestions and contributions.
Code cleanup to get rid of some bizarre variable names and so forth.

1.1.1 (16 February 2001)
Better leftmost longest support (re-fixes alternation isMatch() issue).
Fix for over-consuming behavior of character class/alternation.
Fixed subexpression index reporting.
Support for '\b', '\B', '\<' and '\>'.

1.1.0 (6 February 2001)
Many internal changes should result in speed increases.
Fixed an issue where subexpression indices would not be correctly saved, causing StringIndexOutOfBoundsExceptions to be thrown from REMatch.
Fixed a bug where subexpressions would not be found when nested and combined with alternation. (For example, "((A)B|(C)D)" would match "AB", but would not report subexpression #2.)
Fixed a bug compiling expressions of the form "(())a".
Fixed a problem where using the empty string as replacement text within a REFilterInputStream would throw an exception.
Added a FAQ in the docs directory. Added known bugs to the TODO.
Added REG_NO_INTERPOLATE execution bit, which allows substitution text to include $1-$9 without being interpolated. Suggested by Daniel Lescohier.
Lee Sau Dan submitted support for using Readers, providing both CharIndexedReader and REFilterReader classes. As a consequence, this version is no longer compatible with JDK 1.0. However, Readers provide much better support for reading text in various encodings, and the use of InputStream to do the same has been deprecated.
Clarified (in the javadoc) the semantics of getAllMatches() and substituteAll() when combined with REs that may match the empty string.
RE constructors and match functions will convert any unrecognized Object input to a String using the class's toString() method, so it is no longer possible to get IllegalArgumentExceptions. Suggested by Nic Ferrier.
Regular expressions are now serializable. Of course, it may be nearly as efficient to send the pattern string and recompile the RE on the other side.
Incorporated a patch from Oleksandr Lytvyn to allow RE.isMatch() to return true if any alternation in the pattern allows the full input to be matched, not just the first alternation.
Altered the [:print:] character class to correctly match all printable characters and space, not just alphanumerics. Caught by Richard Trahan.
The alphanumeric match sequence (\w) now matches the underscore (_) character. Thanks to Aryaguna for pointing out the discrepancy.
The start (^) and end ($) tokens, when used in multiline mode, now recognize multi-character newline sequences. In related news, you can override the platform-dependent line separator string by calling the setLineSeparator() method on RESyntax. REApplet has been modified to use this approach.
Predefined RESyntax objects are now immutable, and attempts to modify them throw IllegalAccessErrors. User-defined syntaxes can also be made immutable by calling the makeFinal() method.
RESyntax.clear(int) has been introduced as a parallel to RESyntax.set(int).
CharIndexed is now a public interface, enabling developers to provide their own implementations that may be passed into getMatch(). Suggested by Ernie Rael.
Expressions ending with an open subexpression token ('(') now correctly throw compilation exceptions.
Noted in the documentation for REMatch.toString(int) that the index is one-based. Thanks to Daniel Rall for bringing it to attention.
Fixed documentation note error regarding REG_DOT_NEWLINE. Thanks to Christophe Vigny for pointing this out.
Deprecated getSub(Start|End)Index(int) in favor of the new get(Start|End)Index(int) overloading. Added a note in the JavaDoc that these are zero-based indices, per a suggestion by Chris Cobb.
Fixed a bug where the regular expression "^$" would not match an empty string (or empty line, in multiline mode). Many thanks to James Jensen.
Added better file condition error handling code to Grep utility, courtesy of Jon Schewe.
The license (COPYING.LIB) has been changed to the GNU Lesser General Public License (the successor of the Library GPL). The change is only in name.

1.0.8 (21 March 1999)
Fixed handling of POSIX character classes (not used in default syntax).
Added Tap, the evil water droplet, to the home page (thanks to Jim Blair, corvus@gnu.org).
Changed the demo applet to support selectable syntax.

1.0.7 (3 March 1999)
Fixed NullPointerException when compiling expressions starting with '+' or '*'.
Fixed reporting of subexpression start indices in certain cases.
Removed static initializer in REToken.java to aid in compiling on non-compliant platforms.
Fixed endless loop caused by array read in REFilterInputStream.
Fixed ArrayIndexOutOfBoundsExceptions that could be thrown from REMatch.toString(int).
Updated all doc comment versions to 1.0.7.
Added a few tests to the test cottage (it's not big enough to be a suite).

1.0.6 (18 November 1998)
Fixed bug in subexpression position reporting.
Fixed some bugs with zero-length regular expressions.
More documentation for gnu.regexp.util classes.
Makefile changes for Cygwin compatibility.
Added credits.html file.
Fixed paths to API docs in HTML.

1.0.5 (8 November 1998)
Added gnu.regexp.REFilterInputStream class.
New directory structure for distribution.
Added gnu.regexp.util.Tests class, a limited testsuite.
Fixed bug in backreferences (\1, \2...) introduced in 1.0.4.
Fixed bug in handling of literal '-' within bracketed lists.
Changes to Makefile to work with Cygnus/Win32 systems.
General enhancements to Makefile.
Added TODO and CONTENTS files to distribution.
Added support for Perl5 escapes (\w,\d,\s, etc.) within bracketed lists.
Added matching syntax bit, RE_CHAR_CLASS_ESC_IN_LISTS.

1.0.4 (8 October 1998)
Added getMinimumLength method.
Added Makefile to distribution.
Added HTML to distribution.
Added gnu/regexp/util/REApplet.java demo applet to distribution.
Added support for pure grouping (?:...) operator.
Added support for comment (?#...) operator.
Minor changes for compatibility with guavac compiler.
Fixed some quirks with including dashes in lists.
Fixed some documentation errors.
Fixed 1.0.3 bug in REMatch reporting skipped subexpressions.
Fixed some major problems with alternation nested in subexpressions.
Fixed some pathological cases that would cause infinite loops.

1.0.3 (19 August 1998)
Added REMatchEnumeration and getMatchEnumeration methods.
Added support for compiling patterns from StringBuffers.
Added support for matching, substituting, searching against StringBuffer, char[] and InputStream.
Added toString(int) to REMatch to get subexpression matches easily.
Added getMatch() with StringBuffer argument to save contents leading up to a match.
substitute() and substituteAll() can now take $0 - $9 metacharacters.
General optimizations.
Source code cleanup, toward GNU coding standards.
More and better javadoc documentation.
getAllMatches() now returns non-overlapping matches as it should.
All classes in 1.0.3 are JDK 1.0.2 compatible and should work in applets.
RETest is no longer in the JAR as it is not needed in an execution environment. Source code is provided in the gnu/regexp/util directory.
gnu/regexp/util also contains a pure-Java implementation of GNU grep and egrep, for your amusement and use on non-GNU operating systems which lack such rudimentary text processing facilities. Grep and Egrep require gnu.getopt to compile and run.
Note that due to certain API changes, you will need to recompile any source code that uses gnu.regexp against the 1.0.3 classes. No code changes are necessary.

1.02a (23 July 1998)
No code changes. Added README, changed LICENSE to LGPL and changed copyright messages on source files. JAR file compiled with -O flag.

1.02 (15 June 1998)
Support for nested subexpressions. More debugging support. Fixed bug when escaping braces with a backslash.

1.01 (1 June 1998)
Fixed bug in list operator ( [...] ) which was causing the RE compiler to interpret the closing ']' as a literal.

1.00 (22 May 1998)
New API using RESyntax. New framework for "multiline" and "single line" matching. Default support for most Perl 5 constructs, including the following operators: \A, \d, \D, \w, \W, \s, \S, \Z, stingy matching (*?, ??, +?). Some string optimizations should speed up most matches. REG_NEWLINE wasn't working correctly in 0.07, it's gone and replaced by REG_MULTILINE (semantics matching Perl's "/m" operator). Support for POSIX character classes such as [:alpha:] within lists. General code cleanup and added comments.

0.07 (10 April 1998)
Added more default-argument versions of methods; added REG_ANCHORINDEX flag for substring processing; fixed bug in isMatch() for expressions with top-level branches; fixed bug in getMatch() for zero-length input never matching.

0.06 (3 March 1998)
First general release.

[gnu.regexp] [syntax and usage] [api documentation] [test applet] [faq] [credits] libgnu-regexp-java-1.1.4/docs/credits.html0100644000175000000620000000260107313462716017632 0ustar killerstaff package gnu.regexp - Regular Expressions for Java package gnu.regexp;


Credits
This page was last updated on 6 February 2001

Shashank Bapat contributed support for lookahead operators.
Wes Biggs is the primary author of gnu.regexp and its maintainer.
Richard Bullington III contributed a number of Makefile fixes.
David Crawford wrote the nested subexpression code.
Lee Sau Dan provided JDK 1.1 Reader support.
Paul Frantz contributed a number of bug fixes.
Alan Moore contributed a number of bug fixes.
Aaron Renn is the author of gnu.getopt, used by Grep and Egrep.
Doug Seifert helped with testing and defining the API.
Jason Venner helped with API development.

Thanks to everyone else who has contributed or helped others use and learn gnu.regexp. This project would not be a success without the time and dedication of everyone involved.

[gnu.regexp] [syntax and usage] [api documentation] [test applet] [faq] [change history] libgnu-regexp-java-1.1.4/docs/faq.html0100644000175000000620000001230207364636621016747 0ustar killerstaff package gnu.regexp - Regular Expressions for Java package gnu.regexp;


Frequently Asked Questions
This page was last updated on 26 January 2001

Thread safety
Is the package threadsafe?

Yes, by design. Once a RE object is compiled, it is never modified. Runtime data is attached to REMatch objects, which are created for each thread executing one of the match methods.

Subexpression Indices
I have a regular expression that looks like "(Hello)World|(Foo)Bar". When I try to match the text "HelloWorldFooBar", the first match returns "HelloWorld" and its first subexpression is "Hello", both of which are correct. For the second match I get "FooBar", but the first subexpression is empty. What gives?

The behavior is correct. The subexpressions are numbered according to their position in the entire regular expression. Therefore the subexpression that matches "Foo" in the second match is subexpression number two.

Getopt classes
When I try to compile the classes in gnu.regexp.util, I get errors saying gnu.getopt.Getopt and gnu.getopt.LongOpt cannot be found. Are they missing from the distribution?

While it's not necessary to compile the example classes in gnu.regexp.util, to do so you'll need to acquire Aaron Renn's excellent getopt package, which is also free software, but maintained separately. You can find it on his web site.

Examples
Where can I get some examples of real-world regular expressions?

You could buy a book. Or you could search the web. Or you could join the mailing list and ask there. Or you could contribute some so this answer is more helpful.

Package naming
The official Sun recommendations on package naming conventions state that one should use a top-level domain name, reversed, for publicly distributed packages. Why aren't you using org.gnu.regexp instead of gnu.regexp?

Because I like gnu.regexp better. If you don't, feel free to repackage it. Such is open source. Before you flame me, realize that this conversation has been played out many, many times (and thus earns its place on this FAQ), and for many, many different gnu.* packages with many, many different maintainers. Until I get an official recommendation from the FSF to the contrary, it's going to be gnu.regexp.

Compile Problems
I get an error compiling RESyntax.java. Is there a bug?

There is a problem with certain versions of javac and their support of static initializers. If you encounter it, first compile RESyntax.java (javac RESyntax.java), then proceed with compiling the rest of the classes.

Java Versions
Why doesn't gnu.regexp 1.1.0 and above work on Java 1.0.2?

Because dependencies on the java.io.Reader and java.io.Serializable classes were introduced into the package with version 1.1.0. Fortunately, unless you are running a Homebrew Computer Club antique, you quite likely can run a Java 1.1 or Java 2 virtual machine on your system.

Two GNU Java Regular Expression Packages
Are there two GNU java regexp projects? Why don't you join efforts?

Yes, there are, and I've corresponded briefly with the author of gnu.rex. His package serves a different niche (smaller footprint, fewer features). Unifying them with a single front-end might be worth a shot. If you are interested in contributing to uniting the projects, let us know.

License Terms
I saw that gnu.regexp was licensed under the LGPL (Lesser GNU General Public License). Can I get a formal statement of the legal situation of using this software from you?

The Free Software Foundation has a number of articles that discuss the legal ramifications of the LGPL. See the GNU site for details.

Can I get an affidavit of Y2K compliance from you?

As an independent developer, it is not feasible for me to guarantee Y2K compliance, POSIX compliance, or make any other warranties. That being said, there are currently (version 1.1.3) no aspects of the regular expression library that refer in any way to date- or time-related functions or APIs, so gnu.regexp is unlikely in the extreme to cause any Y2K issues.

Donations, Etc.
This is a great utility. Can I send you money?

Actually, I just wish this was a frequently asked question. But seriously, I would much prefer that if you feel the urge, you donate to the Free Software Foundation on behalf of gnu.regexp. Apart from helping fund important software development efforts, your gift is also tax deductible, and they'll send you a keen t-shirt if you're lucky.

[gnu.regexp] [change history] [syntax and usage] [api documentation] [test applet] [credits] libgnu-regexp-java-1.1.4/docs/gnu-regexp-applet.jar0100644000175000000620000010047707364640770021367 0ustar killerstaffPK7vU+ META-INF/þÊPKPK7vU+META-INF/MANIFEST.MFóMÌËLK-.Ñ K-*ÎÌϳR0Ô3àår.JM,IMÑuª ë(h—æ)øf&åW—¤æ+xæ%ëiòrñrPK3ù5¤DDPK8vU+gnu/regexp/CharIndexed.classMŽ¿Ž‚`ÄgEÁÿ‡Í%–×i¡<É1±‘µ¸Æ|ÄàÇÁøl>€¥.\c³“Éþvgîë &X¨>#]8G|ùsܽʖ:ä ‡êû ÎÊI”Žï÷ÀANèy›õÎ[ìfÞf5÷ äÀó) 7Õ§\é|«’‚ f Ͼå¢>ZŽ]‘czæ÷C°â“pqH0F¥·ß¢§e*¡í§Eð"NØü‚€€Ì!0E›âj°`HÍÚ(ëvЭ´‡~ÅÚóñPKŸ‰…=ÆñPK8vU+%gnu/regexp/CharIndexedCharArray.classmËNÂP†ÿC ¬‚ˆ¤.L ^ºq©&¦‰I£ ‰°±À ””Ö”KÐWq¥6nL$&.xJœÖº£'éÌœ3ßÌ?óýó5ƒ€#ìIˆ0ÚÎPóx›4½cz†ÓâcÞòÝ Ï3%ˆ ©®925ÛtÚÚM£Ë› 1†ÍŨ„%†L@X®VážeÚÖ“Ù°9ë3Dê:CÌtš×£ƒ‚¦ßmÀ –Œ2=ŠºÛ¢ää•åðëa¯Á½[—± 9†5q$|o]æsÉêW©K‹A(•kT¡çŽø_=Šb§–c ÎÉ)Õu£\•±ƒÝ µš U( ÙE£û30$*îÐkòKËæ(RODAË£C2²$Œ¬H¯+X¥’¢Cº'y(ªHçîϲ™Ù+RÊ3dßWN&ˆ¦7Þà´Nl…džHF6í“õI˜@ÿs·‘ s÷=@V½ ÚÔ¦ ÐȹÉ…Â’ê'òêÁU!ê=¬] &*üPKÚJ5ßx(PK8vU+'gnu/regexp/CharIndexedInputStream.class}R]oU=ë]gc³mœmi!kÓ¦ ¬imJùlh\œ&4_¤ ÁÚ¾‰·qv­õº^ü µš¢J~ñ NT|¼ò7øH¼×̬·ÁH»3÷Þ33gæÌ~ú2Îà ã[N+ã‰-±ÛÈäk–WtªbWT‹N£å/ûž°vT(׬ëV¦n9[™¥ò5QñU I8öè`‚Ï®ÎÍ®|P,å¯ ¥ RQH8”w¦o9þšUo êjérii½$Úëõ$DÊž„ÔBPÏv3³­ÍMáý‡Ð Q›+Ql¹µÙ´?¡,²p¨îPŪԘ€”—¯»îö¬¨ÙüynGìú„œºJ‡¼[¥À‘Û¥ÖNYx+V¹.4Œb8F<Ç4Œô½¤†C8ÌÞSNa<ȰF,<Ñ~8©âi ÆÿÖ0‰gƒÀ"•¦›*Ç=£!ѯaj8‹3ô4YäÔÊŽåm3â9šZ¯§Adž=¯á<ix¶C©­ÊöŠgUD/á/K8ò¯R+5Ïýˆ{RñêÃbW\*ìVD÷]‡'Fº]ôû…óŽâq®3­á ¼Î·óSódšÛvƒéÌ05÷ºèã¯j8†ãqÂ_"-ì&)j³ Ó¶cû}rò@ÇAý¨C ob×áâÆ éÙa9ù|ÇH<Jpø®`:w0ÓÆafŸÖcv‘æKãnï¯ú!mv©Å/öqñÝ6”Å6Nq¯ÆmŒ €z6¶?c eO¥Vµžì¤näTJvHµxhQƒŸáK|Eöküˆûaô aç…ã E›÷PÈ%o"n|.õ¾éýM‰ÌeLÙžŽžÝƒ*SI¥ï[¬ÑŽpæ÷)é¼!¦¦ãièÚLfô~tCÖ³« ýºÈ¥ÇÄM^ú7Ltq¢QógLlÐ ïa.˜àzò[ÄÌä>Jë߇ôÞöjéPKŒÞ¶‘PK8vU+"gnu/regexp/CharIndexedReader.classmS[oWþÖ»ÎÆf!Îrë7\¯ 6”^IRˆq¨CâÐ\HC‘`mŸÄKÌn´^Ó¨/U¥ö õJ…PUò‹_*a#µ¨·Çþ>Wê;îÌz¨ÊÞ™9g.ßÌ7ûçóŸ~ŒÓøXEDBrÝif=±.¶6³ùšåªØÕaU…§B‘¸cݳ²uËYÏΗ¯b@¡WÇ‘ûÔòôtaáV±”_(ÌJK¤¢ (°7ï: ßrüëV½)$¨Ë¥«¥ù•’üE¯×“){ŽÌõl7;Õ\[Þ– ¢6¡°rs­aN dáPÉŠU©qm)/!^wÝ)Q³ù%ò)Ý(ŽØòÉw,}ƒŒ¼[¥À¡YÛ¥æÝ²ð–¬r]h8€ƒ1‚xTƒŽý¬%5 cµ×~¯§a¨o¾®a/ö±v\Ã8¤¾Nð<Ñ~iœTaÒˆ^݈F³3ˆ)î8$£!ÑOŸÕðÎÑÓX‘³*w-oƒ=Îjx‡‹ mz¶ã/úVecɳ*"Ž÷ð¶Š÷%ìÁÔRÍs?ãÆT\Øy $ÅùÂVElú¶ëðØˆ·K~¿R^ÃE|ÈúLz†DcÃÞ䪓ŒÀ½'ú^74Âá8¡¼L4Ø âÑfÆmÇöÉõÀØ.{!kÔƒ†+8§+²ög½ªa yÎ3GsúßÞá$Då¢Ûô*bÚ® ¤ÈW¦/ŠA…J'½ˆ Föž—l&ø tb,‰P‡’($‘N2JµEŽõM`_šO`(|Èç—AÇkÇ”mì1õT#rÛ\å‹jÇèe4òq’'ºë‹3ã,éËuqÞˆl#a*ì»mÜ'ÉW£-$f3]¼»ó¤´ P.<|@p$Œc"„øèþ0¾Å £j ë1ôT æc²…}Œ-§ÇnwãKã‡Þß/ A±j(Õ¯»¸ôI Ê\ W¸ãázáü_“ÜI¼?›¶‘xJ`|ÀÐSá&MC!£#AŒAÝ'Û#÷'(S)Ù&R“¸†EêñuÚ$ùÏðkØ3mIØóñ`€Ã EšOQ˜H>@ÜøJê}×û‡!˜ÞåÑ %’C< =µ U¦’Jß¼‰¡cVˆ3ߤ¤3f„šzŒG¦k»L™ÑgÑUYO-¯*tt`d~GúM8óÒœhaØüéÕŒ{ŠYº`€+ɇˆ™É.J+?†ð®k7ÿ/PKS 1s—…PK8vU+"gnu/regexp/CharIndexedString.classmPËJÃ@=ÓÄFklµ¾5¾_m|ä|€„‚è¢R°+ÓvHGb"1ñW\éÆÁ*¸ðü(õδ"¢YäÜîyÍûÇë4¬cÍ@‚Áò‚¦q_;…†ƒ:¿âõR‰À3 3ôŸº—®ã»çVOy-6dùŸg ›aH1Dè”x$\_\»UŸ3° †ìþZÛc“!éµFÑF‘Aóy@W5ÒÜô\1_ („u’Èì‹€4Ϫ<:’¢&zaö€tMôµ§!=HÉiÄD™&0f`òW‘¶µ|~2â¢L)ëäËWÈë,¼ämg:%·D â’ËýÍ^Ì—MÌaQQË)z×9¬¨3•IR/nÈ Ë¤ðç7¤"Cª6£ß>Ç,%×@ …T ¤¢ ûê´EåèßO§uº§2˜³Ÿ08y²mß!kÝ Mã¨õŒñ{te­Èa ÓêQဤJÚ- íºþ½:£ÉÕE•³•M¥õƒR`¾ÃXîäš°_°d¯¶0jË8ÏÈ·0l[Ä츬ªnöPK­Ä3®¦PK8vU+(gnu/regexp/CharIndexedStringBuffer.classuQËJÃ@=cbck´Z«Vµ¾ÛŠÆ½ЂP]T veÚŒéHL$MEüWºqãFð.ü?Êz#º°ÈÍœsî93Ÿoï°Š‚‚†9Ëië·øÕ…^j^Ù1ù7+¾'k·}zÊ=2ÃЙqiè¶áXúaýŒ7|1†±ÿÙ úÒ!C¸z…{°ŵQ·9k1döÕþNÚ`ˆN£éz„+SÓ ÍŸAΗ %*%×$‰ä¾pøAû¼Î½£@TE?Ô8†UÄ‘¾FTŒcŒAÊ›;–ßL`£ &É÷ÿóU `0@e% ÓaPD«JÖÍP¨FÎÝKþm‡ºØ¦p„¿Í å»*ª*æ° Ttð ïrÐkC¢â¶½ß6G޲HèA/è¶hQ<€*¦*Ó_rLï$uë´O¾±P|B*{²¥QM¿ s‡”vƒÁ Ó^ Ý£75õ€àa˜ÆLÄΛQMìˆy Eº‡,ÿ s˜ÐË¡+ [<‡Õž»@éç#R62˜,¾b©¸òL³4â=Fêù0ÙòPK…û“X ¡PK8vU+gnu/regexp/CharUnit.classNËjÂPœ£±©Ecü—Zh +Qðµpw“âµiR.¦”þ•«Bý?J<ÉâÌ ÃÌp®·¿4ð‚ЃCÓ¼T–SþþTÑQÛ]nÎ\B錄´ÊtžªU|âDÜaP»¦P¶FgæGÇœäH HDü.â@hMŒ,M ÑxOp£âMrÝ…ÉyY~Äl·U³ƒGt|y§KðÖ³×jàoŠÒ&<7c™kÂôЄà׌ª/ü$*®œæó/z ôwPKW_&ÌõPK8vU+gnu/regexp/IntPair.class-NËJA¬Þd3ºóÀð¨‚ΈQ„$$Áûì¦]:¬³a²+â_y<äòQ!½ÁCWEUwï;´p¡ADæ¾¶sþÚØ‘¯fN‚A›Ð_»Og çs;MלUÂÕÉ•Ò.8ˆ+äÛ¥âw ÛŠ@#BgËYéW*ÅKõDhÝܾÚÏåJ£½±xžÔ)‡eSî"ÁE¢]Ìüå¡9@He2~•‚q ]¡#R48”ÏÿM_¹«j Ü8ñÝ/z?À)0PŒÐ?PKáFøfÐ÷PK8vU+gnu/regexp/RE.class½:y|[å‘3ÖñdùÉ–e+D‰ àH–C A„Äq@Ô±ƒ'´‰b='"¶ìJrŽr—”(… µY@PŠZHÛ@Ùà6ºM ½ï–Ò›l»»ÝvïmëÎ|ï{:¬'“ýc·¿>žÞ|sÏ|3ó}Ϋ}áX ˆ¿R  Áµ'1¶,©íÑŽ.ëíTÀŠà)mÙ§%”­½}‘žnZîº>º?ºl(𨳬/Œ'ö´;ÀP½¼myÛŠ`LÛO\;F©t4‘ÞÓÃZ*Ý£¥èäcéøÐ²^-52–ÐÖ%bCZ;ñèí¼rg¤cm_'F,¬b×÷lÞÙݹ­+ÒÝÉ`RÓÅà[º6G )ád`wÏæu=] q :äÉomwÇU=½‘îõ×2ø ²KGÜéÞÜÙ»©§kífÁôVb1O¦ÒÒ]åîa͇¢y%16Ü7¶›Œu Çñá±á.-±'½—VökÉT|„Ù´,-÷#‚µc$FþªëŠ'´î±áÝZrst÷Aöh鮑èPüÝZl£îM„ó[Ê™˜ðUÁ 5Õ@ø*,…óH[⦯9!- ´"̯rY‘Ž ÙÁb™=»¯×Òí‘R§ôJ¤£Û#‘¥[‰¸óà€6š&«S ,G˜W‚š_Tàb÷lÕUÁJrKËÒ5鑎½ÑäÚd2zÈ Á .E¨ÚÑ¡ùnÞlâucƒƒZR…Ëá2KËÒ‚}HD aX­Â:XK¹Ù‰ìèª:È-, ÅëW¨Ð ‹ ˜1\u%¬Wàª5u¨°\ìàˆ ÍÐĿޮÂBý×F6q f³Œ-äRú W¨FÂí«ÙË—;¡®Q`ké>Œ$Ò›¢ñ¤¶À5*l‡~„…-¤u— ×v6´FšÂ')q­ ï„wЮ"7V ì­&)ש°¢ìÜÈÒí¤Q8!»ÐJÕ5ªÂ^ØC,¹j÷>f1¨ÂìC8«ÅlW—Fc1ñÅJ\¯Â¸˜ÛIÄ´ƒÕT‰*œ­;ï]ì4B›)73X„SŒ9Sj0â"Rx+Ee„üµŸýu¼Ák’·"?IÃÎ!mXK¤ý ·ÀÍËf»W† Ý4ÕÙ弩6Æ£Y£›TxÛjÅ£šw› ïeˆ=¥ Œ$b :ì€÷#ÔÆi-¹?:Ô6’ŒqÂ.ó˜Åìï–miÝð ánÜKõ"©jÑt[b¤-ÍŽQàCTiËÖ+д˜î'±’h`o”ªML ,*§ÙFJ­¡JMrÀCäeIM¥´$o]Æy‡¹uû õÎIÑý¨å–™™9Bî7ñ#EBcÆŸ¦šNŒuÎÏÀ§ð,‰Š¥¬ïÛ¦Â1ø¬¾½(;”8'|Ï ×­ç0I.‘L+𼩀M=}‘kYÀ´Ù.LÁ \™(£O‹,‘¢æU/_6¤âû4QN0õz¾?k?½ƒˆqÙ¶YÞTø—('­oé£À›ä´_6Õ»'¡õ ²Þ_å´tÍÞíÂŽWá+ø¥m!£Ñ¤–pÀ·(-©8Ǥ ß…ïPwb[#¦=SÙÏÚêžý6Ënc[¿¯Âkœ•NòA·ÞüC~Lµ³\ó®‘‘}k÷jÑsø) 4Ë=¡þëð~aj_:š¤²þ7ÞÜÇû42.*ªQ ~ÉìCÉÚR¹vfþsøµÿ@á)gÞ™ l“×ÿÑt}mâsÿg‘ìzÆüþI…?ÁE“ÙÎÁMõ¥IµÏûà_TøwÜáè>­þ7þþ‹·ƒI”xj}|w‘?Ã*ðê ÅyƒE¨z)0ƒà+×ií¬^mPÅ*D*†-b3Øb’#í7èC›Ð8"4þ+ZðZ¬¦ ˜:bÉT5úÞÚêD:XKŠQ¾¤ÚÄÓ{Ûv“Üíä½Â€œeZÀvëÐ3«Ês uFʬ瀙,3ñY8¯ÂP´tvw=O‹QÎֱˋ@,Ä«âB\€ÐÜR‰."u´'2<:Ät>ÏÆEº3¨»ÛxDJ×àblVðÜÒºXĆۙÏ›=ð Þìß ô¨/ÁóU  Ÿûb%íºÊÙ´³¾6±Ç©àRÛDOµ°š¸U¼——MÕ:1™”ЦïB´ô–ÄÀ¦â ØÇìh0´‰æUq¡ð\‚«÷RöÔJ>ïhéµCCBG–š¥Ä3mT\kæibJÂ2/Gð›&G!ëyB[>W ˜R?+±ÌHŽu*^Ée[mÁ†Ã¹AÅ·ãÕ<<Óv´Ð¾a/GTìáðÈ~h£Š×pñ -D-!cØ&·àf„«æÐ±bS2W]åÉ¡8¥ûT¼–µ¶¦ô†ƒÛT¼wð.Üa>Å9FFш6ÂØÛ9«üöwªe3m).Ìlã.}Ì—¡Å,üæÀÁ ¡œ=¦‚¯™'˜9‹¸a©ˆÿ•GYtœÿCn|V¨+qò¤©-µ—ÓbXÅ$Ví³h’!ïRq?Ž1‹Žòî+• ÑÑQÛSÓúaUhÒI'azŸ8ò^|†¾.""ŸÄVž±Û‹‰Ù4ø¯8ÓÓ*x Uâ9q¸FÞ†Ð:«ô´Ï±u©’ÞŒ|£@3N*O¥)CV™èwfÇz¼ï@Ÿ½éðÄz/Â¥gÆÁT…»ñ.„+*7…3SDû¤KŒ*p§ŠäÛŠâ%Þᔕ÷pV~H8ÿ <%Ó”³ó>jvT/U¼ï`i¨øÛR_²lèò G{‚U-ó³ Ï.÷á¸)™kùh¡9ð±âSž–LŽ$U|œ§p͆)6ˉÃŒ‚O’õ Nr’|Š˜æéå`ŒŸÄOˆ­]©4ÐÖ¶ÆÆ†GYÿ¬é(Sµ&¬â§™L᲋䧤SK“y{˜>üì¬!(Ÿ”ÕGñ9sg›3ÉßÚ0Ÿ)ž+Ä‹㤂tÆ9w.áÆ=N~žÔ¬h¯`ø~NÁ“ÆŒ!ŽŽñ]—Vðe„Åæ’ŠÐXEÆ'•òÐ¥¼„_Pð4ÅÔÀ襃 ÁøJE?êÌûË|û×UJ©³ý¾ªâ×ñk4©šÞ2ˆ»Ë}ýÝ›×^»sSgo×ÊjˆáW+ §[+L+æ7[9œ*Åù éÌåX=0$î¤øƒÒá^^@¦ô B„¯]iŠóž¸¬ä;]>€­×£cC”ã?Æ*ø“’›QÅŸãÏD!)K°r¦ÅrÊïIžþá„ÒINéílc|R¥O nˆi°˜ƒ|¿ë‚`;}Uóu3(àäÛRúí£³‰+¯¥ïº¢o7}×}{軡軑¾½Eßóèû¬¢ïùôí+ú^@ÏBh¿›å{­óûlñ^Føç½Ï¥¯:zóÿ,卸1Ÿ¯äb#ñ²ã9¸ÀŸ¿ŽaåØÒÊ2ñáBÆuý¤¸^¼C]à$\”ƒKÂö,¬!ЪqP ´Š¿—ÑwxΦïpÖ|ζóO‹Ï~Âg·ä #K¸9Ø È Rü–ãp5†~?n?]Ç¡»Évó# X²`µ†ª-!ç4ôôOÂæpÍ4l¡Û¨@…]Yõ×>»×é«™‚!zƒî3à ºks0Àßñ÷LÀ¢ ÛIŸã°OÇpf *Ö& ?讦¥ Øä÷¹&ax°ß ºéé¢çjzFéINÂX¸Ž•Lú§A†ý¤ÃÁ°ÃçðÕåàFR»?ì’šgÕkt97dàA·Cˆ~3è®É«4¯ù…Þjpn Õyë¼Î'á“>õÜÎÿ¹ãIh˜† û=»¬ÞºI¸çEŸë´~°øÜ7.á.…?05âm¬?X¼žƒ‰ hÂ<g$Æß0¼uäOWA#¯s '‡C³á¨'ØQ£ÂRoõ$Gk¤Ÿ·qœÞFv¬S©p#ÜLnÜ‘íA›ðG/»ñ x»@q‡3°v”OŸ{dÝåóLÁK”ªž¼<§B Þ’;¿Hnƒ·Úbˆ=§²ºµ¥¹9+?H7™"9Z‘‡¾3¸ ¼2 ¯êÛ£Îëž„¯ÑÞp¬Ö÷FK¦ª3èV µ *d ÉÍAqb›Øâ?é¯ÉÀ›º¡"P_§g±Œûmòû¤|ÿ_<Ÿ.ú=t{ELê¬!ú¿ÇÊ«ÊBÄ€«®WÝXM@97è>K@ì´½³%¥Lx™ÿ84 ð× ìvpŠ)ež%äÍB¿·±Ÿ>óˆßÔE˜¤{a~‰{¡ú°y÷Šå¥ð–.Û{gÈà ¢‡ô‡¥¢â˜7ðgî-ÁŸ¹ÕëÖ3×™…CzĽuàò÷S»°î¢6ÆŸNî^N¯ûÈ®ÐÇšD|tèxEW *~&qi_ãâ ÿ4:pU‚<+ÎNþ‡#³ÏÐKÇ_>ohõ/<Œ¸â8ìlmeã®{LD&_°Ðâ p°²z3j@w#çB® IˆuèΟE­$“΢þ€Å’ÆFc†EÇh*ÅðHŒù„a¥·JS8¿©y›t¬*þ›™Ä$KlôÞÎ< ó–çñœ*hÀ·–™Æ%ì–«™CKØÊˆŸ5‡­´á)Vôû.3¨2`³aÈÅa«Ïzzæ ‹ÔŒÿ²,eÖÓ›OÚ¢ÛëËÀŸ’ËKÈt6~>ÇóÔò+ÃP–Äг’â\%)|’ÂÅëám~Ân·rÇMå& ‡­ÆËÌ~ÅÑ<ÆZs§a¬©ìôΣÒéë±CbÝH.Wè=j­¶eaÏê³qÆÚrxÕe>Û1ì²´M@ýá* XŸÇž*ØFgŽ€\Ðç±aì´B2›1‡[ûöÓ39QÿçqIØNlí9|‡Ï~Tz.€~©Ér²‡-:O¿ÓhÍáÎ#­Çp7ïz/ë'p«á²Œ™»lÏÑ<Æ^s—a J /9ƒ]V-ÕßW@¹^¢,IZkx•mÛjX³7K¼§¥_-MYïqðøm¼Ó`_Ó|Tr9 /JµVS˜öÂ…—ga‰¿YÜoÔû›é¬ÏWQJ³mבV³;[°ÙÂ{|æ5Ù:«øŸÎÖ§`ÔÐû#>«¸o4æÿ­)do œ )Õk“szòyÂÞ$NÙö#–øc­6Bé 4ùªé\|™¯Ú˜Øk}NñÁZÃÇ ×&f¾ãsæ`ÍD‰ŒG‹eðúËSøDHDî›2”Ûº¦ à Í:!G^)Söã%Œykîtp[^ål‰ŠÒ€þËf©úÓ¼ % ¼…òdœÓó0+èÊÛBi‚^å8Üô:ŽÃMFwîÌ_Î/’MÜ#µïâ6þt ŸÅÀ»“¸—JÜ`ÀÝ–qjÑÉ+ЀÏðÎâL>5¢qåð3÷RF’¹ËÿøH²¹Sn†›üâŸJçÑ~ÿI¸há$;ê÷ø;ΰU{žaa{aa‚ ¾(`/ _$ØvJÀ¾Ä°Sû Ãó6:‰‹ A9Ø IOôÁ»Ë¶Ô|ÚR¬ –çðVð¬ß4Å·èøMåøß*ß'·,õý¦`vÿ£b餕„Áw¯Ký\ô¾Íe ÛßJµÀß|œfm¯Kμ\œ™EÙN(ÈvÁÌc0k z­^ªZßÕ©¬ü¯»¥`üƒŒÝO§Çoëëóñ{ùuŸp M} øý)|} ñY¸@Z‹oˆÊüË¿PKyC¤hź1PK8vU+gnu/regexp/REException.class”ûSQÇ¿WˆÅuMÌWía/D+{˜f®F! †Ö4«^hÜe–¥¬¿©j¦´É©? ?ªéÜe‘­h¦Ëç{Ï9{Î=çòãç×ïðaÏ%t0 –zÌâe¾WåTuo›WmÝ4$øú^i¯µXE3ʱ£ 9§.¿HÄsÙKù0†î¤iÔlͰ״J3tºV‰œ0èpÝÔD.žT…âó*„âo*¹xfÙ±9ÖT’…bÖQM%Ï©¡H ]Ž’_MÐ*¤ CБÔÌ¢àΦS>o„‘[Udã¡t¹«ùÔ†c¢9eÝŒ»üöÛ*Õæ«š5©ÌíBƒÃc)ÚLš;=iÝà™úî· ÚV…+¸€@'®R¦ä’5kº8H£ =Bo"}…×jZ™ô‡ÇÒ­ƒÏÛ–n”g%ÄB-ùñÖ+¾mK¸ÆÐÛRS†M´Lã%N­1ætC·çeLẄÛÔò?£'ê¥RÃkÆ)fMÆ-Ü bŽAá–eZ“U‹—ô=÷1Ïp%üw~mR¦ù¡²Òæ¶VÑßñ·>qÜ“ ‰ùmò¨Xd˜i{3ýgÝí_(™Ö®fËXFR†!ÇÈæ{vÌ}û’c¡à2Dÿ«ŽÆáˆðZµÊq6)!Ãp&œü§ƒ°[QÅ„Œ²ò¿]¨ÂKË|Ó˜ULÐÄÚfÃ]øÑÅj“\Šú)ºTdh—;õ͇§4'ž‹<)ÌhÂòfÝÚæKz…ÓåáÓDg<tלߣÎê§½‹¸Dß—‰zieâo%ò á÷ÃXÛíñæ6µÏÝNSD?­ þo˜,ú1U†¸™OâVñwWNÌ~ÁB&:1þKûH¯GCò>¯G#xâð>Ö> ñLcÝã­ÓHñ².“GFĘàzœÒ¢u¸®–=“òÎ3Êã²åUR0±¬¶?'×¢!yýö1ªv‹£B]åÙÅ·"Lp¤–¨i’³D´®w¢IÏ&¯°}ŽÃ‘ƒÞŒ‘+‹³pkm?n´í%W|ÔÍј{]űýS~Çô'5²Å§ÔøPK{L{íëPK²«˜*gnu/regexp/REFilterReader.class}T[Sg~¾ìné V9´(Õ(i-¢¡E u‘CE=¸/a5$Ìfãð¼èu§7:ÓŽÓ^xÃMgLœ©S/½èU§7ý7¥Ï›Z@:;óž¾wßãó}¿ÿýë+¸€Lø(‚(B¸Ôˆ ¹,䊫B>Žbׄ ‹ßHŸDñ)Fåìz6ÆDý¬‘Ò¸ ±}.䆸;"MŠ4l;;QþvSÈTÓÌ(˜zkÓWh™ÊæK)_g©¦æÆ‡"¾Þ̹kZ¡uê¾ûÐMåÜ|65ø^>Ëãðj)“Ñ~MØ,”C¥Éu@¡øÚÝPèþoà±u×wòi½¥ÓsÚMk_]óò^0¢0¯åñ ©úáš—Ñ·ÀÆ i- xy=SÚXÕþmw5G‹ÉÒ F¼…5m¸þƒùÒæfÁtͺÌã+cŽ#ç%áÑùBÉ_ÓžDèÞ—Ÿ¶@ûµÒú¥ç0«Ðù ŠÏ6ÞÇY]è¶ñ.Þ³Ñ#ä4ÎDpËÆÎÛ˜ÇmwÐÏiïK:íkë,ظ+n½8#m,aÙÆ ¾´ñ•ؾÆ76î5­bÍFÚFRþH"¥pòÈFÚv‡¾ß|üÐ6dØm‡¬Ž˜Ü ךÓùl°Na3%$̸Ó7Æ™{Å7çqMûªâì³:àçK«DS8î8ÕØÖ†Œ@!?I`RØl×Ðyf ­Èz=ñeÔ ÁVd´Ž#£IΆ °ÛG[¼ïMð77 u­'fj.²æÀ JvòAAálü `=l":ø aÞPƒRHRå=uNœTyoKä'í£6NÝ$ïJ$_@%^"´”4^À(ÃLœ/ÃJ\(#ü ¤ít.‘¢—qWXÆUž3µªŸ§|3ðgâ9"¯ÑKÖ b?¡]¤ÄMËæ½2*ˆnÓdVðÖX¡í—°—¨[4‘5³”–)ÑÅ'YÁ±ÇXL>ÇÛIël²öçñúa3T»+á›ë:s4'Ä/\A{™©Íò^5?ÂÉØ­Â‰áÎÖwžJ!b0÷¢I­ÍÛ{s˜d÷À(b¸ÎQN`7ø9¼k“pq¦°…i|‹|Y<Æ-üÌ »Í«ZÆ~£çk,â^GÅ7½¿¾ŽSäJ–eü›+\µ¸Õ§ê~'–MƒÖ3œKTprÐŒ™¡§h‰YO =ƒ³¶“B*f~wç‘¥º–ÌôÈ;Ѽú4H³ ¶ÎpŸüûÄÒâ#Çóu\D¾šöƒzÚb%DÞ˜HÉWœ:Xe‘ôÃ*Ø.þPK+|ØTݰPK8vU+gnu/regexp/REMatch.classTmSU~n^X  ­JRMEL6ôMªöEÛm4-lñ…%¹ [ÃnÜl:èøÉ©3þ…~²ô _:Θ´Z§úÍÿ‰þñœÝ¥¤@µc2“sï=ç<ç9oùãïŸ!ˆqÜT¨˜Œ-+r­–¹25£;Å!¾úM=SÕÍJ¦°|Cƒî«aeæ¤mèUãK}¹*t ܱÏV-S²B {•eéª\s(V~Çhα ³rF C–«z¥. rt±Êåº$ÓÝ,®X¶@Ø0KrdÝÑmRÉ,(Í’@ÈtQó{S Üp‘i:‘ÌïÎ…Ô¡¬U"í¼aÊÙÆê²´¯2eC8¡ú<¯â » 0¬¢ý|Š)èW1à]^Rð2ùï@OÙ¶e«Å+D0‘œ§$Φáœà(F$FviÖr浚e;²4µV”5ǰLˆ^¯sÚ¶V'öË/9¯âT&2Fʨ¾B\Ÿ0ήèvŽË'Kä à¸À¡Ý¸Ø(—¥Á1Œ¨x §¨2‰\2K˜Eò¾àtã4N*x\÷GVqorälrO{=pn²^«QÏ8Ì*ÞÂùÝ}y<ŽåÙöœŠ.D8É nC¥n{ü(û/û)žŠtæx:rÞ¨PñiFºéuÊ,ùoCä´7\'òPQÀ,å—Èíg#ÐUo,×}NïcFÁ•'Öó£'¦ÑXngÂT‰JdRÖlYԩ˽žÙµ^ÞpŽÌ™Ž%0šØËbbL椊°È²ÉëŠQŸ4*†Á'¸®àÓ'×’z¦I3º ê™ÈºìÂ¥m—%nÍ;ªªÛUÊi왨øm掕UÜÀejxUšg…9t£ÒRÓx¯hÊz½Î™*º½SME“—Ú«ú#žæ(T»9«aå´Q•8NAýå¤ÙÆ•=¾ìõå_ÒúºrÀ—´Ø®•àe§ßÃt»ì"§´ûxá7ˆ|J4Mi?âH‹^lâßâÛ·xj3ÿG¯ÝÇ«¿¢oÂÅ×è䡎&£ÆµËxÓ»71Î2J~€÷I#ã»~‹}¯˜B0XxˆcëÄLðüÆR±Ÿ0@ gnEŒ‰Óë[ic-¼ÝÄE¶š`ÏX:ð”àB!6j»~}ý®E àjéÈ£õ­ß5ÑÆŠºã³:ƒ*ц›˜Ö‚”BðÜÙ-Ê0ÑÀb¡p+ ¢>Пm@‚7ßê'ÉU “ÝÅM_}‰Ú੟£(¬VI=íV ½tÏ·Ê=Õ*ÞfE“ì[MP¹ Ú°Ëé.zX§wÐ1ðî&ða8ÝÂ{Û|æp•¾ -ÅCÄšÈ'BC!¿æ½cÚP¨ÙÂÊÂzÆ\÷íñMµðY¨´¾õ½{ºÛ®æyÞôÇpUŸÒ ¢ÄË1JÛºª ‡–~‰ðrù‡¸F+ei±&>×¢-Ô·§¯A¿8ÿPKr©&¬ PK8vU+#gnu/regexp/REMatchEnumeration.class…SKSAþ&XF@䥈à;ÙQ_à0h‚  2 Kmv©Í.EYþïxÐ#Xe°Ô*½yðG©=›y–[5;Ýóõtý˜Ÿ¿¾|ƒ‚>̪1t-/鈢X]N>IMêîÂbÊòJÂÑ]öT„š–ô=iêV195¿$\µ ­þ©çfrÇ…:†2ìdV8†n/õyS0(³©,K+á1Û*»ºåætÓ#¸frdv4%A0„2SÊoúÂ%Û‘hIR#ß{ ‘©CãN”€ÃZö\†ŽíÈØ¢î¤­¼Xy2©S/–}[:#/‹zy’¢¦LQ–Kˆ‹?§ cv^È †%2^i^8Oef=èfèŒMü+TÖu «8ê Â’wŸ>aQŽRŽ'8#!éG Z¥t†£ íR:Çq´ŠÆ8:ª’ÆÑ>†û±ƒ²I§$±áxQ¸¾œ.-›Q\@¯Š‹ÔœÆÍ8" \⸂AjÏ‹4EXù®á²Šë Í{Ýs Cö&–ö«W²WD=ná†ŠÛ mûgÀ1‚(õÄ.Ê•îï0Ô[bÕ ºA#‹OìI M­.ˆe9„e÷zþ hÆÎz4×U[f@i´Å(MDFõÙ­ûÇÐ)¥ Ž)t2¨F™F×ÈËœ2Y<ñ%Gì‡ ËpoE1ŽÇ ½±]Sypóâ¹(½MºÓ¾÷-öË|(ͬí9 bÜ0N!Ô@E„èE ùqzA!Ô“~h›Þ@zã6½‰Ÿ/Swý†Ðßiý½#Àú{-Ý¥Ðÿ8iÍtÎ䩯6qò=ªï¶ç¿xw€¿!!Ú_kqú ^i´Ÿ¥užVœV"±‰d$üÀL€ |ÄU¥ÿ-·äu„ßq3„imÞ¾%W…ѹuD¤çð\…܇+8½Ž:-D»Œ~U‘žþòÃ]b—"9LÚ¸Ïø0I2£m7C¡=†ƒÔi'ÃÉ5tIbç?ãÃZ5Lv`ã+Æg?áéwT¿,žÕIø]ºµOÈiŠ´OT¨>½*C—L¡•rH|XÌømšþPKoa0M5ÜPK8vU+gnu/regexp/RESyntax.class•VùEÛ´M›nïƒrã¶EZQðÑmºm–n6aw[(¨kZ– $)—Šâ}ßžˆ7¢…©‚?ûGùñ½ÙtÒ„„OçÍ÷ÝÇÌlþù÷ÚuÀ¸„* Ú“™éœ›t0Uëx¦8„j Zö'Ž$Ò‰Lr 6¹ß*¡V‚›ÊXn.•H§N$&Ó®]Cê°2¦ÛŽ®ªc©qÅTì˜)A›¾àÆ*äR™ä š­ ÃVv9šå k†¢K°ÂTA%†Ëˆ‹£%ñ;XÿôXlT‰¨Š½S‚VÏ»‰JâL»$hðæª†í±–H°¬,hñ ‘F·õƒšíØ1[ñF¶”'ÏŽ¬²sóÖ+\š-,5®§±‘øpÄT㥜¨¶ØŒ9‡©´/0â1Kó#.æ*–®ÀçºËø»lÏ4fµr±(ªZTÑ}—kn&_p!ôÃZTh\5õM| DZʴ6—im&­êÉT!_|7¦ ©ôÀ`ª`¹ìo0•Nei|vcéTƵÜC‰\¢ÍáØ&¸\¾¤§÷&3ªg÷âÃѬ£±1}pÒÍÙô„É`]/ :$Ý*öh½»eØ&±—áQx,“ðD¦ü×QHÍò´v£YÅÐAHâUZx µtÚM&ÒÊÔ”›Ï«¹\6'C=ÔQ°'eHÜnOùëÙ;.AíÖT&UØ‚}°_†½eÙŽSz j¦Òn½†,q°5-˜š^Ú­ÞJ¾+&.ÃKë:J–9êÀVWxã=½ãTƉ~lž’!È|‘aêÐiš¨K¼Ï©W§h÷¥ #Lúµ Û}#Ã#l÷­ Ãl÷½ *Ûý(C˜í~–!Âv¿È0Èv¿Ê ³Ýï2lg»‹2Œ²ÝŒ Q¶»"ƒÁvs2ÄØîâl7ï½lhýÔ# BVv:7…·0íÂFT à_ @7ÍÓetÄéQ…4Ð÷œ>Í #np3â·"np;âw"îðÄÝ^Šÿ— x9â^‰x•€W#^#à[ß*àÛß.àµˆ× øÄ=îEÜ'àõˆïðÄý@|—€7"¾[À÷ Þ$à͈ïð}ˆïðˆðÄ[üvg›€F9ž-oNƒœ†9âTåt˜ÓN#œjœnçt”SÓ(§§1Nã­¢w×£ø,{tÌ;7tìðÆàº‹~% _¢_U}ÕW`Oß`?ñ¡æ ¨PEf}—ÁY> ‰ó\oWéÁ3J*+PeÏihš‡}— 5op£CELJÿ‡U¾hU€inµ–[-­`µþ -šƒãܤ)•Xƒ&G}1¾ª\ÜÕžxUß<Ý .\‚“äj&'Z–ÎÁsWÀ¹X´;ÅíÖóLV—Ù­Çôg᥿a²hØ /û«z¼+ U+Ú^¹ oÎÀɶw®Â3šib>ž…Ogà3jfá‹–ZZ‚´ÔÑÒŒ *’ ÿªšá8ãsÈÀÓo E¦¥‰–_ó,w(zö”‹šÍ%êß‘ú%8‹®>ïî‚¢{Y¶ ù:? UsjõUó”ϱ ç0sÓàKÎ3É”xø·Eø‚_wK½orIlE]i+ËûqYèG1ÑEf }i÷ÍfY"³ºÖg^˜¤ÞFK'-]´tÓ²Ä׾ƴ¯•¸øÓ?n×½‹û×PK{n'©•qPK8vU+gnu/regexp/REToken.classuQÁnÓ@œ8IM)MÚšÒŽS0÷ $¨@Š”‚DJ½9ÎÖÙbo*×Fß”  ŽTâ£oí•PØòÎÈ;;óÞÛŸ¿¾}‡ÇسPbXeæ%<äó3ïÝ«ÃÙ.-˜ k§þGß‹|zoǧùãˆ3˜’ÏSÚþmÖg(g2Pªêy6È Ÿ3°%„<=RÄY<ä2L§ †Ó¥ s6!ùõ¡üMyrXÄTÏyú¾ðj9ÿÊêÙ¨¡ZõE¹±Ÿäê]ÑîOý$¯‚OúW=”¼ß=¶a›6𨍻InÁÔò¿ÉÇT÷$‹ÏÚÎðÏìFi"dø2;9á •Ç`)Ñ‹(²qw•õ–{Ûf¨<£¤ÏÉ˨fvð0ŸÊQ®ì:VTaƒ­“Ÿ¨,†úh–%-"nvHaÐW¦ÕT½„5dA¨¸k¤Z%¶JÈKÆų†zo%zŠÛ»@ã3r5—œX„…î)¥„»î´.±IиDÙ\(ÒÛ[â–b­‚é”ÛhëÓ b©”–¹Ð14£\HÒÂm-Üp{Kt”ã¬äÆKÜÏ«£s;ØÕòÕ¤äM÷+¹Œ¼ÕÒpÛèj†žêîoPKľ›xçPK8vU+gnu/regexp/RETokenAny.classu‘ÍnÓ@…Ï$NMŒ›º¡-?IÊ?ØNÃ:U¥ˆävÑVEd…Oƒ=‰,£ÐM_ ¤¦<E¹“ñWlYsÇ÷›3çÌ|ûþå+òXÃc9†å@dNÂ>:;O÷o¸ØïU( å[ ªàï¢PpÖe(Æ^ÚëogQÄ`<Ý Eg±ËEöò¦ÕaPÚŸø—–mgñOö¼ƒˆþ&«Óým«vßK:Âç#î·Ü?,lI¼euuX ¤]%YD%Wþö4…‡ð?ªO¾ôÅ™‚£~€ÿ௨û„>Xm“‡³röZk¯½óã×·ïˆc5Ä:"´|Þᣵ¾¶ÙßãbÕií­ó¶…aöÿ2C\„=f3$<1äbHÛ jÏ Z» V¡ñ—ª¾ëø¶pùˆ»µÆ1·ç’^+’R©÷]Înx‚¿{Mîo:Í.בÆ9†Økê¤Ç’8³fÿ YéP‘H‚ႎy)ŒsáJEVÇäáÉòæ’yj\°‹u£E!Ÿ3¸‚œ†« ó' c )R > R´Äk„ݰ7`ÈowŽÕuDÇÚ|OtVÃv›ûµâ–ŽnKJ½x‰"8ƒÅMÁÄ- %Šp2Uš-K3ûT3éQ&Ç'žð‚ÛÞ–1,ܛ޼%ÃßÕ¡áŒÜ×ZÙñ_‘Ö ©~è·ø3¯Ëq‡ˆq1ziÏ"=ò6‰Õg (QµY>DÆ<Ä\e…ÐÅU#¶dV‰}€?0ªê',•¨¼˜Uw ÷+.ÇPʪѹ/ïU–U³ÊÇß?˯$K1Ü1ÍRy‚ë˜>7pó¨w.J¤K™7eÏ */?­hIÌM¡3cæ¾à¾™cÎ4Æx8e2<ŠÆ«þPKW}¼ ,PK8vU+gnu/regexp/RETokenChar.classuR]OA=Óî²v»‘ÖOÔí¶PDD¥XÅ“&E@Œ%1,íPé¶ÙnÞý<ŸxáÅ„/ !úêƒ?I½³-¡îfgfï=÷ž3gæçïoGðc | ÝE»–px‘¯W3“såwÜN¯˜Ž‰¡ãlŽÁ—_¡a!ÍÐbÙUnWXŽ¡½ÈÝ)˶JµR–ÛE—@~=šaÒåghËZ6Y+-qgÎ\Zãd´Àp‘A.™®èšÐ³MŒBFÆ.ðu^HfO)™ðd4§¡DO,²%„pIA÷¿Ò½ ½¸LzôLTˆÏSû 7ˆ>ô(Ÿ6¢‰Zƒ‚ BgDà \õiQtËÙòî¤Í*Wq ×ô3t®šïÍÄši½fÞ历;h§:›¯»*9›Ô¹E^öèÙ³{‹#Æ`èÙ“~ÓK«<ï&3ç„2Ñy†€é8æF¾\ÙP1CA‚å;»QuyIƒŽ¨1D‚ µR…¡¯™dÖu,»ø¼¶¼Ìdt^Ã(0„õ…tô(²Ò¬T¸]Pñ# “•çC 9N7ÄMÑBϤs¢ÿžÔd^¨'ÉM—pPôaPgË5'Ï_XkCt~>zéy+: šeúP)¤UÍŒæc­GÛ¨?mhoäßBòªg¼|Ê?*oa8ßAWH^üŠ+>ŒJ”ºº‰`H:ÀÍ-È!h É#Ÿ û·?Ê,$G>ÿùCE‘Å]t±øîs‘Ñ ®Ò&ÔMÇ~€mb2ölÊã‹a19”Ǽæþ^Éï%0¯ÿŸà(fôJ»Ý6bû¸wL4Œû ¢nÏ@‰ª=<|ý¥C²")ÍýFß>R†t(SGÛˆävņհ·_)üª^Íð̳ùé_PK¾žÙ3¤:PK8vU+gnu/regexp/RETokenEnd.classu’ÍsÒ@ÆŸ%„ð-bÓV[µ*lüä‚vF™:à z°:ãÉ”,!&&ÊÉ“‡'/\œ©8zðèÁ«ÿø.0£-5‡Í»»ÏþÞç}wþþö ® ª!Æ`¸"²îòAßz´µÓ{ÎÅ–p4Äró[ šà¯|OpÚn>³_Ú–o ×ÚO¸5µk‡­ƒUlþsºÞ±ƒ†pø€;µæê)¯™OâõžCÔ…&ÁFÝ=ìØ{>×q :kÛ“ˆÑ=ìoBÒq9bf!Ñ¢¼wà œÐ°Ä°t´'uœ’‰¼íÛî ™eEÇ$‰&ø LSÏò:T$R`8›Æ9É<Ï=ܱΠMòœð¹pÃŽ”_ ’uû ùâ\ëîEí6j殎2JRR7ÿ'"ªÝïsá¤éM TØÑRRÞö„n’¢Ø˜¿/™ÎÂõiÃve‰×èþ>ƒ y‚!½Ý‹‚¿ïùW©zê1Ù ŠäLC’VREˆOV½reÇ¿b1†ÍBnù=Vh~:»öú-4å#R¥re„°´Õ¸£TUêkÕxÁˆ¿ƒª ߨlB1Ô§S1QpéÃø×   1ý.£8³°HÖbôO–³ë#Tš)¬‰y©X¦}i;SÊÁRå3V§"†[4ÆpóPK‹¡¢¨&PK8vU+gnu/regexp/RETokenEndSub.classeËNÂP†ÿáVÁ"Ѝ(^w€hÝc\H0!©ša¡«–J¤¶†‡rcB4qáøPÆ9ÀÂË$ç2óýs9çóëýQá@C„wehøÂã‘qSo „¬K§Úb„ìJˆ¬ Ó#Eó®õ,¿!1NÕü•v©äÕÒ-!V:‚1=)®Â-ü–e÷…ŽE¤‘»!*¤“DI KûO éXÁ2X»ðÚÓ–I~PFGN¸7‹¤±ªc î*Å8H±dïN8 EóÞz²Œ¾%]£øžtÏÃnWøÕR›8õ¤œ±ºØ(µu°­Òwxž__t¬jRÍaèwÄ…×8?ÊÔG‚}oûì«H®2^ž ËçÚuù°òŠü3f¶‰­¹:Í+‹^æˆ'˜£,…åÂvgœ¸¼JØûPKø­yGÜPK8vU+!gnu/regexp/RETokenLookAhead.classuRËNÛ@=Cl\·„4Є¤ôéØÐm“¶ˆ"R*RN2C2ŽŒƒò+ù‚n²©T\©‹ª«.úQUï$âF²=sï¹çœ¹×ÿýü…æPÔ0Æ®‹vÁçuÞi>¯ny‡\”=ïpyŸ;5 Cü2€aÌç ‰òåT‰!*xÝ ÜcB°]µéÕ}†‚y¾²ïøë¢Æ;¼V:OóQÂK9ªTV¼‘L–]Á7ÚÍ ÷·œJƒ˜Ä R7såçØ)4Q/|ªðj@êjµá ®c ×5Ä/Úï“P1>†›& ëÔi¢2vËÀ,t¼ÈTÊÀܦ„9Òç6ƒî¹u±æ{M©›¡âZ»Ù¢Þšgn¾+êÚ{{ܧ²(PÍ%ñˆ!ZÊ]UÍ0î´Z\Ôt˜x¨!Ç03*ÙmidåJ2Éa˜G–A“¾— yï9Ryë 7xÏ4Gz·ùÕN•·×G^‘sÀÓ¤,RcÌõܶdÉ0}ñw›—‰qÓkûU¾æ681côÐÐ  ŠÞ2Jãü5Ú¹t–Ù/ù±ß˜Ú~‹ +ªÖw$ì¹3]ÌÒ>Ù…éYvJ ‘îBK)E5¥þAâ4—O©!î*½A@·lbK÷"= Ö=d‡²‹$+­Yvü~ˆ';ö "Ë~…{"¿ÓQ°c9yü6äXÀSª|F;…¸ž÷Ù2‘׊Y‘xeÙ'd)s‚ä †áM¿¯ÿPKÔhí;=ÁPK8vU+gnu/regexp/RETokenOneOf.classuSÝoZeÿ½NϵŒ•m̹ªã«¥ê¬ íj‡­âh«kG…º9 oé™p ô°4ÆÄ›þõ¸%†›&fÉzmbv¥‰×Þë_">/‡Ön09‡÷}žßÇóñç¿¿þ ãØRà`¸X1Z‰&¯ðFâöüjýkn,|yS“ÁÛÉ Ô¦^7¶é:û ø°˜h™z5‘ã%³ÞL1¨¯Mý!g`O…›‹º¡×Zµ,7*惎dœéz™bF²ºÁ—Zµ Þ\-nT¹ô]§ÓÑ cȆa ^œcð…3›¬Z4*‰åDGd.^å5n˜s¦£ð(ðã‹¢4¸àv“ç üpõ¶þ  —äZÑ,‘¨D8{Êlz«ØÌe¾ÃË©ìsEXá©HAƒUH ix WÈ,y’u‘ãÂ^Uðú‹õë¦j¸†7IJ3 •ˆhÎ<ƒÞPe¸0X„ˆªL`œa4<°r©Z7ÈÕâ ÓÞAØ ¾cŠƒ·ÅÁa 2%t¿«!‰h,ÂmçÜÅím½b,4ë5Aö>¡—[µC |JÖŠÙÔÊÍÖæ&oRšŠYÇú=s¢ÿ³I üÇûsR‘—ÁP¹Š7Ên,ং©\ƒCzF(J¿L`|¢!‹šha`®ZºE,Ó4¯æ †KáL¿¼B!’Ó°„Ïí&æDÒgâ`µ;Ù91W+ Öžïeo{DKÝÈ‹fŽ'õ¸€ù’„3é‚@Êa]Ã}|% ¿çv7Êåy{ñ= %1áCÕî® ª ÑÌLÿ¦Dú¹Ó+?!br¥Þj–ø‚^嘤§Ùƒƒ¾´’Ý7š{zÊô£µ¢û3ô–¤s'='¼g§¥m£O1²pþ$ ó3ǃӻ ‰ ¯<êü؇ý¡iíᛋž?SÔå=ŒÆâOqõ„ðÆ~„,í³%–tJSJwO±9’rÜBâÆ’ª_ŽùU oíaÒ¡¬h÷èúB~ç8ëW—üjÒÙÆ°ßéWðžø·«0Ÿr"î§ñßqþ$?>n!åÜçI”óþ®FcD{}_:62™ž‘ …[ÙIª—ª"{?´0¿&Í´qMáàpÇ<ßZøtMpm;1 ‹»<‘ó×1Œç.Áx""þIt Ë=Ò[Ô!Ñ£Ùhà·£GÍâÎF¢¡\–¦ä6ºå?B.ˆûd _øœ‡¸k¡¸+3Ÿ¨aùQçŸÿy8Øk¯ÇŽCÚ‘ŒÜŠÁØüPK”ÈxƒÇ[PK8vU+gnu/regexp/RETokenPOSIX.classuU[wUþ¦¹M“–¡´ʽMA@жÒ´…HšÄ¦ÒBË4™¦É$$(rU/x¿aë|‘µ\}Qiñ²dùâƒþ |qù|÷ž)LÖ9ggïýísöÞ3ùýßïÀ†­¸áB•€•i½ä/¨iu:ïïïÈPõX4:ì‚]€¼X)ÀGû!è°$˜Ó‹†¢CJ¦¤š±ƒV ºÂÈ!ÌŒ ô‡Øt‡„P$Çþ@ì pt¸§Ÿ“@¬?1Í\ #Aˆâ±@°‡A5ÁX¬ìãà<|ŸÛ#ÀSו¬: LdètËGÃÇ•SŠ?£èiÜ(hzº]€Ý8“'¥SÓ‹ª^¤ËpéjZ1Ô”Q»¹úæÅî-!"æR¤® kº)e'Ô‚OÂZ4US’Z$J¹ï!ÿèÄq5i´·P0§z²¤dŠnøÑêÂvµ‡¡­´jôiº–-eêž6¦Øš9¸#«IBþæ°¥bÁ)¥ÒSê´šjÿ¯’}lNa%ì6S¬±U5žÁÓ.<ûpÙMc à45‡Z‚tØ$Q :ÑæÂ>+– p÷®„upr zÐÍ$A¾qV «†¡¢…n-­n@Ð…ƒT¢Wg2%IFžc_ñž[‡$ôñ¦¤Cñ(u¡QÈeX–c…K+Þ§ŽJˆWŒ‡§4C-敤ʊ~ ë±8(á0›x(Hî´Z*EÓbXĨ€¦cÖíß°qÓØfosËÖñ½­£GÏž?r®½mËzÿ>ß¶ŽN c8ZÎQˆcs¢“\Ñ#” ñ`>ÿ€ø˜ê.I™H¦ÔÉ@W°»§WÂÆòa¨u¦°‹ètuš.`5€=UÊæ4,îÁ®Òä¤Zho’ #Ë&Á–ÇQý:…žr#Œ '©~6•` h6Ù9uPëìTqZ@ÕhG;#À÷¨—âqá™`ZÄ9"h;*á".¨k^lNç\YfŸó”ÓæPhd„/iàår¦‡85/‘iG2cžOÄ«ÔÑJF/eE¼nŠù)EÄU'ˆþ„ˆ·HLR³dD¼CbŠ[DÄ{$¦ J~JÄ$f¸D|DbžŽ@×X,éIgH4Hħ$–¸¨">§$M›l–Y?¦ÛønÜñ\©T{µŒŠíTbþ>Õbpù áj vöX°Dx‰/%\cÁÌ·Ì‚eÂË-¸Žp½¯ ¼Ò‚WÑï ~’pƒ¯&ÜhÁkÓ'Žÿ ø=7WzÌu£¹:Ér6“ÇB>ò©¢µÉÖqußÂ۰û€m3p4Ì]„Ú¹óåÝ¿«æP~žÂŽŠçRZŽi¿§Û‰]ep•ré õb«ïöü€½Uèl”÷߀Ã6gÛm÷ÞB××üÔVñôÐè¤1HcŒ†Aã<+4¾¢ñ+?iü3¤°¶ñ{ôÎbIcíøu¸l7a·ï¶ßÄ_´}ˆ…?k›®³ºÚªþÔ~!áyn“00‹¥¬˜­XÎX<®ÑI‡fàfÞ²YbÖ¢ž.»³:2ÃᚬáF䑯ŒWݰìõ² {1OX™×ð g±LN.¢°‘çä jê-'e¹Î— \ÛÍc·Õ·mÎv¯0Çq¢R´}°›åÞY&q·ÖŽ- 7Üúò‰Û(ɧ𕜠´ƒDù,M ¸Dóð72/VÈÖU+¼ ·qÙ»z]ÞÆy yëíó˜,Û¯Â+(Vì‡)8?‡j¥ŸáOØä+ñ„]~-žpÈoÄNùÍxÂ%¿Oˆò»ñD­S~Ÿf—ü!Í¢ü1ÍÕò'4»åYš=ògñïà-pÝlþ/þPKœW&tM PK8vU+gnu/regexp/RETokenRange.classu’]sÒ@†ß ¡))ZªBü¨Z“ÅúQq˜±a†ö¢íÔ‘+SØBå¯x§ã…7Ü8SêÇ…?Àe= 8¶Z3“œ“³ï>ûžÝýñóÛw„P@IİÔtƒ¢Ç›|Ð+n?Ùí¾âî¶í6¹™!ùï ƒÔî20‹’–Ã0ã¸}îö©RcH4¹¿é¸N'èT¹Ûô[ !ݨ0ÈV·ÁâUÇå[AgŸ{»ö~›*áŽí×IVÔ«'Ö²Z¶Wq|À¥ê)›B^2j*’˜§E‰v„2‚$,þmz¢£òË Š^±¬šà¯áþd›ö„«{ ó'ïĪ 1DwºWçO6'CtĽ’h“2I49Ž´qez£ˆ‘N¥lŽ"£ò“gñéØQ„z#—?Dê+ÎK(kÉì;„CCóßbVû‚å²F?+ï‘Qÿ€…üs’Ë/FH™¹ürÃÐovž®ù„½L~$Šéœ˜|„[‰}€Â³OSýîNõëä$L±`f>ãi.ʵ‘pÍ’ƒ³#¬P‘ Ú¤  O0 Çí¯ÿPK²Èû6jPK8vU+ gnu/regexp/RETokenRepeated.class•T[oUþN¼¾­×®ê–Ó4…”›o©Ë­ÀÚ4$iR\’’4¥áêħŽ[{Ùk@ˆ—þ‰ò- YBy)ÙH U<5¿‡gÌÌîF„&EÂÒÑœ=ó™o¾™ã?þúõça œªYÝB[ÕÔæFaaz©u[Y jCUlU C:ìÚž=>{Ø[4ëäeÞU6B»nÕ>§£½Y¹­ýƒ@:³, MµªJàØlÝRóÝæªj/UVÊ€ŽXIH½sà…IÖ”=W·êÍnsVY5{Ýu” „á;' âÝ“Ž#¥Sͧˆy³b¯¶>H}j½Ò.[Uµ©ªÅ—4Çðbf%Œ§(ç­Êg•B×®7 ËjÍnµ Œ"Nõ•ˆˆ}Qǃßgpù?Á×é§ËG=Ær9³ÌSú!ÉBA–™ÂÔ˜Gžú9N±Øê¶×ÔL½¡pžº a€_íøm¹6ê[zŸdô Ä Ÿ Ý ²¡¬¶ƒÁ_àý†ð„ï$Ëþ`vƒ[¾›¨ï–þõ8¹OÒ’†×÷a4^L‰Û1²…Àż© 3øÎÜØÅY3,ÃRsðÊæwh Fvh>S$BÉà ’’¥ýøoPK7’(aPK8vU+gnu/regexp/RETokenStart.classu“KoÓ@Çÿ›8v†¦'”4¼vj%<‚* )Rà@J‘8 Üdã'rȉ_‚€žzAHH%ˆ8ràÆf“Ú¦ø°;³ó›ñfí_v~ Œ ()1¤m¯gúÜæý®ùèÞJç%÷jå $†™É ƒâñ×®ãq W_X¯,Óµ<Û¬¾ãÙ%†HÛ ê-S¯îÊ.·,¿â5xŸ7JÕ=U¼dùl€KO¾Œ‰%\iŠ‹Þ¹Ì7\ϾBA 7i áÆ?PKš´Q<PK8vU+$gnu/regexp/RETokenWordBoundary.classuRËRQ=7™É„0˜T0ð­yÁWDƒy€ÑˆUB…’²J‡ÌM j2Qܰð/pCV±qcàcá¸ñü±ï ”8U3}ºûôéÛ=÷ÇïoßáÆ0*p1 VÌFÂâ¾¶šx’›¯½âæBÍÒÓµ†©kÖ[Cð8‡ANçfò³ ,ïÀº25³nk¦]Ôª ÎàÎÍfEŠš(&¯h6׉½H•o–¹EyE³KË ‰HáHƒÌ²fåM¯q=Uø«ñ#AOEIAÊÔtð “Ï6V–¸5¯-U¹Šnx<¼\Õ*õ„TÐóïù½µV.×¹-¨§Tô‹lˆæ"rZÅ CÒÌÒrÍ¡çqŽÉG3”)Ña§ìN\ÄY—zÚBkØÛSED”fÄ~£^à¶Í­ÇVÖ¨¶q\Q0ÄÐýR{­%ªšYq$´‘TtÁÓ†aPJ¨¸?é™|ªÝ¸JXo¬¬2ôG ‡s¶e˜•t£\æV*ZôâƒëYÚ‹ÛÂ.©GŠaèxI*ú?±’ÕUnê>LàŽ‚{4x{ªS¢Ë¸a'¨rÜ0 [€H>¿-ªÈb¦µÐ¢˜bš¡·Í=ú ¾¹ZÃ*ñi£Ê1JK÷K¢_)ÃCžWÜ6(äwñ}ôÒÎL[$+ªNÀOŒ¡_ä+dº'ÜIih'“ëÉ&º ÷Ñ~AŸ30ޤÅž&åàåMô…ä/ˆ½Ç‰x¾ ŽIJJó(¯·úybÛ‘Ö%ê6°oHÚ8Ðp2òºÜDOÈãÄrïœäèü!Ï!_`5ÚÅu ¸?¢õÜÀÍýA³4¨‹ì˜Pö4Ño©xƒÉ-ÈÁ±]Ü]ØBØ9Q]ñàd+â‹Ó}ÚWÌ"·¯&=‰l Öÿ÷cáŒÄv0Úb2S‡8ôâtJb„¢I· $h·–Kü7ì&.ÿQšIÇþÀ̾dRÌŠIÚç—ÈWæü Ó¿^3n?˜6®ðn€.‰7hü)ªY+,QLàã=PK'âtàš´PK†™¨*$gnu/regexp/MessagesBundle.propertiesuRKnÝ0 Üðd“´¨Ñu¡è"».Šö|m ±)—’¿¹{)ùãÙ‰âpø™¹ƒŸÁâà_ȉ‘bÄŽ"´t<7B-S]ÕÕüjýRR¿KSòšº*ÍT`æG‚)D_ ¯_ßÀ3(Ù< €2ŠåÌ„)‘ð·µÃ™ö~B‰´Îõpj"4¦c$É@³~è )<ƒðB¾<{—z8`G¡íÑ39“ÓZkpãH½J„ƒº+ì-MAš¿3rò­'ûïŸ>¿¾=À³O}˜u{!KÎs·’µ¹ëu+¿™}Ä+\t猨«™GL¶'×\-™#†ßž(Ý@ôç ÒƒjËwH‰SOÑëY=«ÿpÈ«;£‘Í“i¡…=_WvУ~Óëjc…BÕUœ/Yîð[zuÃiŠ ŽÄì!Œžý8Y“NòÅ$k”¶äÿSañË{¡”k‚šÖNª}? ÔiÒöë¬Ùºìb“•k.z·¨³÷æxºa›wóën×?W¥\vwê¶%nZÏ8˜-ÙcTQU]GzÑÝKP-2‡”5ƒË6R‹ýPK â-º–PK8vU+gnu/regexp/util/REApplet.classWy|Åþ&–¼+yl+RL"hˆ øŒÉ (á°DlÇX!Ž ]ËYD–ÜÕ*vzi m)½[èJ1-”–K€KJ›B[zЃÒû '¥wKïúÞ®d­…_ý‡fö{ß¼yó®?úìÇQ‡.q‚EË’™|·¡'õéÉî¼™JwGz&'Óº©À%à¿N;¨ukÐmãîŒ6¡ç{û-qZË$»c¦‘Ê$7 ÔÔÒyŸ¶·ß¡{8;”1µib,J¯ðÙkµ)³»_ÕÓ¾ŽÖóÏ1*°¸ÂêÍ›f6Ã4s¿À’Š`§>mnMéé1’¹S™É<™¨÷ºÆ¦eó¦%®Oerz&WÅë×F³l`}Î2µjû¾ñl*¡“ЕʤHE]kÛ.úèËŽéÍý©Œ>˜ŸÕÚhZWp¦@cÕéU„®]ÓÞ:µwúš6±Jb%Îhiu8qÇèuzÂÜÌšë·ð>{±g©8‡¶ššžš–hC«ÀúZ‹ª½= ™‰ñH&?¡š™²HêæB˜õŸ+Ñ…N Xk-´Ð“!Z^t£CÁyËŸw7‰õ `.!5RD5³öÜ‹X«`%ÚÉê$.Ä–£÷4k¹¬¡[=Çvœ¯` ]µ02Ð'm.ÁÅUYÖ—Mg >L:•7·Ú!zp‘‚^Ò^Í’ˆà2òWëÂ՘Ɯnöj‰I#›ÏŒy± } .Ÿ/‹;1™Íè*¡+ÈÀy|›‘ëÕ’ýÚ!ÊCÿé^D±]bÎhuVS´Œ–Ôí]=´«zq% WïHùJ)h(ØIšîHâœiÁ$ÇŰ]ÁˆóÌCZFO{±‹MÙ r¶ˆRþi™ÄxÖð?.±×L>Q¦tvß4ã×HŒ2ݤm,D“Ðç‘CŒŒ)wîeÕºŠëÈúa=™OkF(2=i蹜´•H/(‰RÒ´íò"‰x= ® l¨ŠQÉï›ûŸÇ–;›ÈU^‰bRâ òí55¶Õ)9µ±1…ú3 ó=IÅKÈ—v~J¼/8§Öñj•‰¤zÒ j¶¦nx©g¿”ô*.Ô“éQöÐ4^)áÃböÐkT¼Ž:XÅ»!»K4Ú.|½‚7PëZÐἸó`)–1çMnÔóìÍoåà(t⨩O0ï-*–J¼“áúœž¦.Äè;¼Gà슅ÑtZOjé#Iý!cÎר‚[ÈÀ“°Š÷Q§Œ&3Tî¡„–ÓùÔ¨}ê=|ê›ñ~‰œÆf~HÁ‡‡²o ¡¤,u°[9šÐÌô‰qÂz8a§Rcæ8'íG%>Ψ—Ñq+á¾KÅ' ŒòâK4Ø®¼GÅ1ê ¥æÚÊABÚÂY÷9ÏY¾TøùdsKkÅÓ hHø`=2û!:GkYöi‰%¶ì³àaº$Z÷pz7PzGÆR&ßE^|ŸSðEg'bæÓ˜k=ÁñXíÈýÈÁJ%UÝ3{$¾Š¯P¶Ÿ,#U¦fPÚzð5|YÁ×¥o)”ø&_ qØ6î T>Å·$¾‹ïX-Ÿ:81+«ô±hfLŸæäú¶ÄøVPYhj¦Îáÿ>{æÇ5®ÅhÍGûo9~¤à§e·8|ߛ߿Ÿ îI.„_âÜ‘¢5+T±Þ:;ö{ñ~®à×dôB–ÄoñÎÿ«èíÙôäÒùvyO«ø=zÖ„XÓŸøžè;åBæÿ‘ÖJüÕªÖ\ÅÏϨø‡À™Ž† H¥­ ;¤FÖ‡x1•Ç¿9H^~/•.!/6ã_Ü‚¶“ë·$ÒÖÛD¥+:àÔUÐCr‘>¦ z2ºõ¤¡Oª¢ž§Z"§ "ºlÐK¥6´#ݲ–IJUûsTË¥ªhšJZ|”A%`Ú$ð&~ºšml‚ì˜ÐÒåÕK(˜Õ‚Ê¢ÓÈÔO–‘w'u#Ú ŠÓI“=µæÈzˆN¦·©âeÒFUÐSn‰=·IéK!~Sœ]R¬ü²;Åó·q8²/ÜÙ³{_ÏÈvX!΢üôÄ[Özªd%ÒjU´‘ýRtжš U{G?Èä˜>I׉™5X_»Ýl¦¬˜¹Œ­Y#Å:4;Û†#C,[+ÅÆ…²ž¾Ë6HqËš*²ò²ó¥ØÌ¢@Edũ쀰[.[(ïí‰Eû˜q‘=5ó¦]*é}BŒe'1vïŒ ^fŸ­OŠmLZ¾4ŒôôW6Ü*ÅÌ ŠéT•b€ÉŽÐÆlI¿C 6îßÀ²RÄX¶xlŸåÎa)vÕX¹‘eWI¯±r£½r·eˆýßÚN*åX6o$ô­©´Ž³¸j¾žør§™—0‹øue ¥Q–ÆÆÒHצ5ÒÃéj²Æ%¥‘nak¤ç.Ú)ˆÓé÷ ¥½<4Þ=‡åqÿŠ"VõwøWÐ>0ƒ†ÎÖ°a„Æð-Ï=3WûQ\ZÀÖ9DãEô÷·w04‡}\50‡]4î, î® ‹Ä¾Å³¸º³y/쬛E‚ö·Ï!÷§Š˜˜E6èj?†,í’ëâIS#.bi:Þîq¯ðYÄ«gqØ¢.S[TK©k^ék-¥×[ÌëËÌë™Y20ì.[XtëÙDÞ-è º-zÐ]Q[²õ¢¿q7ÖmRf }7ÅM-ʺÞvX- }?òÜÓíþ·“­a%¨<‚fÙ@ïš;¬ëã=‚nž9zsÜÿÞº">8‹#íÈ<íÈ<­Óm[skÜ[·Ïâëw”y‡Å$ÒL¿»r‚NŸ—BÐÑÅÄö®²>›e;í–ÓŽÚð¼C;HéQkOx;×b,£˜S(s %N‘Âv?\å¸}jÇmî’Îãeþq§ Šq‹þ™Yœ щº>ÏËîä'Ê+NðŠ{(›AÏ‹s°Y ‹}bï¦oGñ%;¯éÉ¢XÕñpÇ1<6h9çvÜo§Ìãa—»â ;ß[®çì·|IÎþáÍP}^ ˜VÄOÂn+ dêãTaeOR6ü,¬ÖmòÌ ;¨öˆÏ}øU¿ ªþßÛcP±«Çþòy øócTIñ9‚j)ào3…yç¬×ÿ÷"þÉUóZfË]wÕÝE‡jÄÜF>se¹|©àùºÜíEü÷ðß2<[‹‡¬NqÌç{OÅëüÏÅ⮀±¸; êbñú€pÇâJ@(±¸žXÜGP „5Ò@`3 ž€XLƒ7 44D 2 –ÒÐAšâ šbyì^ÜDŠñº9ú9*VŹÑZ]´½ ç€Ü6´ÞÕÛÐ&¤ØÐ…Hµ¡-ÈWZy‰+-íub¥µ'æ±±Ë˜×Æ¶;±tbÒÆ®tb6¶Ó‰5ÙØˆk¶±=ì^ package gnu.regexp - Regular Expressions for Java package gnu.regexp;


 [image of the evil water droplet] (jpeg 3k) no gifs due to patent problems Regular Expressions for Java
This page was last updated on 21 October 2001

Latest Version
The latest version of the package is 1.1.4. Download gnu.regexp-1.1.4.tar.gz. You may need to rename the file if your browser changes it.
The GZIPped file includes the Java archive library and the complete source code. Versions 1.1.0 and above of gnu.regexp require Java 1.1 or higher.

Java 1.0 Compatibility Version
The previous version of the package was 1.0.8, released in March 1999. Download gnu.regexp-1.0.8.tar.gz. You may need to rename the file if your browser changes it.
The GZIPped file includes the Java archive library and the complete source code. Versions 1.0.8 and below are compatible with Java 1.0. Please note that the compatibility version is not being actively maintained.

Reference material (for latest version):
API documentation (javadoc generated)
Syntax and usage notes
Change history
Test applet
Frequently asked questions
Credits

Technical Notes
The gnu.regexp package is a pure-Java implementation of a traditional (non-POSIX) NFA regular expression engine. Its syntax can emulate many popular development tools, including awk, sed, emacs, perl and grep. For a relatively complete list of supported and non-supported syntax, refer to the syntax and usage notes.

Terms of Use
The regexp library is distributed under the terms of the GNU Lesser General Public License. The COPYING.LIB file included in the distribution contains the details. This program is free software. You are encouraged to adapt it to your own needs, and contribute to the program's ongoing development.

Installation
1. Download the latest version.
2. Use GNU tar to extract the files.

tar xvzf gnu.regexp-1.1.4.tar.gz

3. You will be left with the HTML-formatted documentation, a Java archive file containing the compressed bytecode for the gnu.regexp package, and the complete library source as well as source to a number of related utilities.
4. Add the .jar file to your CLASSPATH setting. See the README file for help.

Mailing List
To join a mailing list of gnu.regexp users and developers, send an email with the word "subscribe" in the subject to regexp-request@cacas.org. You will be automatically subscribed.

Mailing list archives are available.

Contribute
If you would like to help contribute to the ongoing development of the package, or if you have suggestions for future enhancements and functionality, please send email to wes@cacas.org or better yet subscribe to the list.

Some applications built with gnu.regexp
Enhydra, an open source application server
xmlBlaster, open source message-oriented middleware
Ganymede, an RMI-based directory management system
Hamilton, an enterprise application server
jEdit, a GUI text editor
Muffin, a filtering proxy web server
Jext, a GUI text editor
GutenPalm, document compressor for PalmOS
Mckoi SQL Database, an open source SQL-92 database system
Link to your application here!

Relevant links
GNU Java Software
GNU Classpath Project
JavaSoft (Sun)
Java-Linux Porting Project
Kaffe OpenVM
Japhar free VM
libgnu-regexp-java-1.1.4/docs/reapplet.html0100644000175000000620000000365307240421274020012 0ustar killerstaff package gnu.regexp - Regular Expressions for Java package gnu.regexp;


Test Applet
This page was last updated on 20 March 1999

About the Applet
The applet below (if your browser supports Java applets, that is) lets you play around with the gnu.regexp engine by compiling regular expressions and testing them against arbitrary input text (if you like, cut and paste into the input textarea). The applet JAR is about 27K in size, and includes the gnu.regexp library (24K).

Basic Usage
To get started, click the "Match" button using the defaults. You should see two matches found. Turn on the "ignore case" feature and click "Match" again. A third match will be found. Then try your own regular expressions (the applet defaults to a Perl5-like syntax) and input texts.

Troubleshooting
If the applet won't start, you may have an incompatible version of gnu.regexp in your browser's classpath setting (usually the gnu.regexp library will be downloaded for you by the browser). You can remedy this by quitting the browser and adjusting your classpath setting to exclude gnu.regexp before relaunching.

[gnu.regexp] [syntax and usage] [change history] [api documentation] [faq] [credits] libgnu-regexp-java-1.1.4/docs/syntax.html0100644000175000000620000002355307320215357017527 0ustar killerstaff package gnu.regexp - Regular Expressions for Java package gnu.regexp;


Syntax and Usage Notes
This page was last updated on 22 June 2001

Brief Background
A regular expression consists of a character string where some characters are given special meaning with regard to pattern matching. Regular expressions have been in use from the early days of computing, and provide a powerful and efficient way to parse, interpret and search and replace text within an application.

Supported Syntax
Within a regular expression, the following characters have special meaning:

  • Positional Operators
    ^ matches at the beginning of a line1
    $ matches at the end of a line2
    \A matches the start of the entire string
    \Z matches the end of the entire string
    \b matches at a word break (Perl5 syntax only)
    \B matches at a non-word break (opposite of \b) (Perl5 syntax only)
    \< matches at the start of a word (egrep syntax only)
    \> matches at the end of a word (egrep syntax only)
  • One-Character Operators
    . matches any single character3
    \d matches any decimal digit
    \D matches any non-digit
    \n matches a newline character
    \r matches a return character
    \s matches any whitespace character
    \S matches any non-whitespace character
    \t matches a horizontal tab character
    \w matches any word (alphanumeric) character
    \W matches any non-word (alphanumeric) character
    \x matches the character x, if x is not one of the above listed escape sequences.
  • Character Class Operator
    [abc] matches any character in the set a, b or c
    [^abc] matches any character not in the set a, b or c
    [a-z] matches any character in the range a to z, inclusive
    A leading or trailing dash will be interpreted literally.
    Within a character class expression, the following sequences have special meaning if the syntax bit RE_CHAR_CLASSES is on:
    [:alnum:] Any alphanumeric character
    [:alpha:] Any alphabetical character
    [:blank:] A space or horizontal tab
    [:cntrl:] A control character
    [:digit:] A decimal digit
    [:graph:] A non-space, non-control character
    [:lower:] A lowercase letter
    [:print:] Same as graph, but also space and tab
    [:punct:] A punctuation character
    [:space:] Any whitespace character, including newline and return
    [:upper:] An uppercase letter
    [:xdigit:] A valid hexadecimal digit
  • Subexpressions and Backreferences
    (abc) matches whatever the expression abc would match, and saves it as a subexpression. Also used for grouping.
    (?:...) pure grouping operator, does not save contents
    (?#...) embedded comment, ignored by engine
    \n where 0 < n < 10, matches the same thing the nth subexpression matched.
  • Branching (Alternation) Operator
    a|b matches whatever the expression a would match, or whatever the expression b would match.
  • Repeating Operators
    These symbols operate on the previous atomic expression.
    ? matches the preceding expression or the null string
    * matches the null string or any number of repetitions of the preceding expression
    + matches one or more repetitions of the preceding expression
    {m} matches exactly m repetitions of the one-character expression
    {m,n} matches between m and n repetitions of the preceding expression, inclusive
    {m,} matches m or more repetitions of the preceding expression
  • Stingy (Minimal) Matching
    If a repeating operator (above) is immediately followed by a ?, the repeating operator will stop at the smallest number of repetitions that can complete the rest of the match.

  • Lookahead
    Lookahead refers to the ability to match part of an expression without consuming any of the input text. There are two variations to this:

    (?=foo) matches at any position where foo would match, but does not consume any characters of the input.
    (?!foo) matches at any position where foo would not match, but does not consume any characters of the input.

Unsupported Syntax
Some flavors of regular expression utilities support additional escape sequences, and this is not meant to be an exhaustive list. In the future, gnu.regexp may support some or all of the following:

(?mods) inlined compilation/execution modifiers (Perl5)
\G end of previous match (Perl5)
[.symbol.] collating symbol in class expression (POSIX)
[=class=] equivalence class in class expression (POSIX)
s/foo/bar/ style expressions as in sed and awk (note: these can be accomplished through other means in the API)

Java Integration
In a Java environment, a regular expression operates on a string of Unicode characters, represented either as an instance of java.lang.String or as an array of the primitive char type. This means that the unit of matching is a Unicode character, not a single byte. Generally this will not present problems in a Java program, because Java takes pains to ensure that all textual data uses the Unicode standard.

Because Java string processing takes care of certain escape sequences, they are not implemented in gnu.regexp. You should be aware that the following escape sequences are handled by the Java compiler if found in the Java source:

\b backspace
\f form feed
\n newline
\r carriage return
\t horizontal tab
\" double quote
\' single quote
\\ backslash
\xxx character, in octal (000-377)
\uxxxx Unicode character, in hexadecimal (0000-FFFF)
In addition, note that the \u escape sequences are meaningful anywhere in a Java program, not merely within a singly- or doubly-quoted character string, and are converted prior to any of the other escape sequences. For example, the line
gnu.regexp.RE exp = new gnu.regexp.RE("\u005cn");
would be converted by first replacing \u005c with a backslash, then converting \n to a newline. By the time the RE constructor is called, it will be passed a String object containing only the Unicode newline character.

The POSIX character classes (above), and the equivalent shorthand escapes (\d, \w and the like) are implemented to use the java.lang.Character static functions whenever possible. For example, \w and [:alnum:] (the latter only from within a class expression) will invoke the Java function Character.isLetterOrDigit() when executing. It is always better to use the POSIX expressions than a range such as [a-zA-Z0-9], because the latter will not match any letter characters in non-ISO 9660 encodings (for example, the umlaut character, "ü").

Reference Material

  • Print Books and Publications
    Friedl, Jeffrey E.F., Mastering Regular Expressions. O'Reilly & Associates, Inc., Sebastopol, California, 1997.

  • Software Manuals and Guides
    Berry, Karl and Hargreaves, Kathryn A., GNU Info Regex Manual Edition 0.12a, 19 September 1992.
    perlre(1) man page (Perl Programmer's Reference Guide)
    regcomp(3) man page (GNU C)
    gawk(1) man page (GNU utilities)
    sed(1) man page (GNU utilities)
    ed(1) man page (GNU utilities)
    grep(1) man page (GNU utilities)
    regexp(n) and regsub(n) man pages (TCL)

Notes
1 but see the REG_NOTBOL and REG_MULTILINE flags
2 but see the REG_NOTEOL and REG_MULTILINE flags
3 but see the REG_MULTILINE flag

[gnu.regexp] [change history] [api documentation] [test applet] [faq] [credits] libgnu-regexp-java-1.1.4/docs/api/0042755000175000000620000000000007617541044016065 5ustar killerstafflibgnu-regexp-java-1.1.4/docs/api/allclasses-frame.html0100644000175000000620000000312007364636621022165 0ustar killerstaff All Classes All Classes
CharIndexed
Egrep
Grep
RE
REApplet
REException
REFilterInputStream
REFilterReader
REMatch
REMatchEnumeration
RESyntax
RETest
Tests
UncheckedRE
libgnu-regexp-java-1.1.4/docs/api/deprecated-list.html0100644000175000000620000001166707364636621022037 0ustar killerstaff : Deprecated List


Deprecated API

Deprecated Classes
gnu.regexp.REFilterInputStream
          This class cannot properly handle all character encodings. For proper handling, use the REFilterReader class instead. 
 

Deprecated Methods
gnu.regexp.REMatch.getSubEndIndex(int)
          Use getEndIndex(int) instead 
gnu.regexp.REMatch.getSubStartIndex(int)
          Use getStartIndex(int) instead. 
 



libgnu-regexp-java-1.1.4/docs/api/help-doc.html0100644000175000000620000001604507364636621020454 0ustar killerstaff : API Help

How This API Document Is Organized

This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

Overview

The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

Package

Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors

Class/Interface

Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description

  • Inner Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary

  • Field Detail
  • Constructor Detail
  • Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

Tree (Class Hierarchy)

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.

Deprecated API

The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

Index

The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

Prev/Next

These links take you to the next or previous class, interface, package, or related page.

Frames/No Frames

These links show and hide the HTML frames. All pages are available with or without frames.

Serialized Form

Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

This help file applies to API documentation generated using the standard doclet.



libgnu-regexp-java-1.1.4/docs/api/index-all.html0100644000175000000620000011675207364636621020644 0ustar killerstaff : Index
A C E G H I M N O R S T U V

A

action(Event, Object) - Method in class gnu.regexp.util.REApplet
Handles events in the applet.

C

charAt(int) - Method in interface gnu.regexp.CharIndexed
Returns the character at the given offset past the current cursor position in the input.
CharIndexed - interface gnu.regexp.CharIndexed.
Defines the interface used internally so that different types of source text can be accessed in the same way.
clear(int) - Method in class gnu.regexp.RESyntax
Clear a given bit in this syntax.
clone() - Method in class gnu.regexp.REMatch
 

E

Egrep - class gnu.regexp.util.Egrep.
This is a front end to the gnu.regexp.util.Grep class which sets the syntax used to RE_SYNTAX_EGREP, which aims to emulate the standard UNIX egrep command.

G

get(int) - Method in class gnu.regexp.RESyntax
Check if a given bit is set in this syntax.
getAllMatches(Object) - Method in class gnu.regexp.RE
Returns an array of all matches found in the input.
getAllMatches(Object, int) - Method in class gnu.regexp.RE
Returns an array of all matches found in the input, beginning at the specified index position.
getAllMatches(Object, int, int) - Method in class gnu.regexp.RE
Returns an array of all matches found in the input string, beginning at the specified index position and using the specified execution flags.
getEndIndex() - Method in class gnu.regexp.REMatch
Returns the index within the input string where the match in its entirety ends.
getEndIndex(int) - Method in class gnu.regexp.REMatch
Returns the index within the input string used to generate this match where subexpression number sub ends, or -1 if the subexpression does not exist.
getLineSeparator() - Method in class gnu.regexp.RESyntax
Returns the currently active line separator string.
getMatch(Object) - Method in class gnu.regexp.RE
Returns the first match found in the input.
getMatch(Object, int) - Method in class gnu.regexp.RE
Returns the first match found in the input, beginning the search at the specified index.
getMatch(Object, int, int) - Method in class gnu.regexp.RE
Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags.
getMatch(Object, int, int, StringBuffer) - Method in class gnu.regexp.RE
Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags.
getMatchEnumeration(Object) - Method in class gnu.regexp.RE
Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
getMatchEnumeration(Object, int) - Method in class gnu.regexp.RE
Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
getMatchEnumeration(Object, int, int) - Method in class gnu.regexp.RE
Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
getMessage() - Method in class gnu.regexp.REException
Reports the descriptive message associated with this exception as well as its index position in the string or character array being compiled.
getMinimumLength() - Method in class gnu.regexp.RE
Returns the minimum number of characters that could possibly constitute a match of this regular expression.
getNumSubs() - Method in class gnu.regexp.RE
Returns the maximum number of subexpressions in this regular expression.
getPosition() - Method in class gnu.regexp.REException
Returns the position, relative to the string or character array being compiled, where the error occurred.
getStartIndex() - Method in class gnu.regexp.REMatch
Returns the index within the input text where the match in its entirety began.
getStartIndex(int) - Method in class gnu.regexp.REMatch
Returns the index within the input string used to generate this match where subexpression number sub begins, or -1 if the subexpression does not exist.
getSubEndIndex(int) - Method in class gnu.regexp.REMatch
Deprecated. Use getEndIndex(int) instead
getSubStartIndex(int) - Method in class gnu.regexp.REMatch
Deprecated. Use getStartIndex(int) instead.
getType() - Method in class gnu.regexp.REException
Returns the type of the exception, one of the constants listed above.
gnu.regexp - package gnu.regexp
 
gnu.regexp.util - package gnu.regexp.util
 
Grep - class gnu.regexp.util.Grep.
Grep is a pure-Java clone of the GNU grep utility.
grep(String[], RESyntax, PrintStream) - Static method in class gnu.regexp.util.Grep
Runs Grep with the specified arguments.

H

hasMoreElements() - Method in class gnu.regexp.REMatchEnumeration
Returns true if there are more matches in the input text.
hasMoreMatches() - Method in class gnu.regexp.REMatchEnumeration
Returns true if there are more matches in the input text.
hasMoreMatches(StringBuffer) - Method in class gnu.regexp.REMatchEnumeration
Returns true if there are more matches in the input text.

I

init() - Method in class gnu.regexp.util.REApplet
Initializes the applet and constructs GUI elements.
isMatch(Object) - Method in class gnu.regexp.RE
Checks if the regular expression matches the input in its entirety.
isMatch(Object, int) - Method in class gnu.regexp.RE
Checks if the input string, starting from index, is an exact match of this regular expression.
isMatch(Object, int, int) - Method in class gnu.regexp.RE
Checks if the input, starting from index and using the specified execution flags, is an exact match of this regular expression.
isValid() - Method in interface gnu.regexp.CharIndexed
Returns true if the most recent move() operation placed the cursor position at a valid position in the input.

M

main(String[]) - Static method in class gnu.regexp.util.RETest
Invokes the test function with the command line arguments specified.
main(String[]) - Static method in class gnu.regexp.util.Tests
Runs the testsuite.
main(String[]) - Static method in class gnu.regexp.util.Grep
Invokes the grep() function below with the command line arguments and using the RESyntax.RE_SYNTAX_GREP syntax, which attempts to emulate the traditional UNIX grep syntax.
main(String[]) - Static method in class gnu.regexp.util.Egrep
Invokes Grep.grep() using the RE_SYNTAX_EGREP syntax and the command line arguments specified.
makeFinal() - Method in class gnu.regexp.RESyntax
Called internally when constructing predefined syntaxes so their interpretation cannot vary.
markSupported() - Method in class gnu.regexp.REFilterInputStream
Deprecated. Returns false.
markSupported() - Method in class gnu.regexp.REFilterReader
Returns false.
move(int) - Method in interface gnu.regexp.CharIndexed
Shifts the input buffer by a given number of positions.

N

nextElement() - Method in class gnu.regexp.REMatchEnumeration
Returns the next match in the input text.
nextMatch() - Method in class gnu.regexp.REMatchEnumeration
Returns the next match in the input text.

O

OUT_OF_BOUNDS - Static variable in interface gnu.regexp.CharIndexed
Defines a constant (0xFFFF was somewhat arbitrarily chosen) that can be returned by the charAt() function indicating that the specified index is out of range.

R

RE - class gnu.regexp.RE.
RE provides the user interface for compiling and matching regular expressions.
RE_BACKSLASH_ESCAPE_IN_LISTS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_BK_PLUS_QM - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CHAR_CLASS_ESC_IN_LISTS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CHAR_CLASS_ESCAPES - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CHAR_CLASSES - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_COMMENTS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CONTEXT_INDEP_ANCHORS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CONTEXT_INDEP_OPS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_CONTEXT_INVALID_OPS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_DOT_NEWLINE - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_DOT_NOT_NULL - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_HAT_LISTS_NOT_NEWLINE - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_INTERVALS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_LIMITED_OPS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_LOOKAHEAD - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NEWLINE_ALT - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NO_BK_BRACES - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NO_BK_PARENS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NO_BK_REFS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NO_BK_VBAR - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_NO_EMPTY_RANGES - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_PURE_GROUPING - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_STINGY_OPS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_STRING_ANCHORS - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE_SYNTAX_AWK - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_ED - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_EGREP - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_EMACS - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_GREP - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_PERL4 - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_PERL4_S - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_PERL5 - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_PERL5_S - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_AWK - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_BASIC - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_EGREP - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_EXTENDED - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_MINIMAL_BASIC - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_POSIX_MINIMAL_EXTENDED - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_SYNTAX_SED - Static variable in class gnu.regexp.RESyntax
Predefined syntax.
RE_UNMATCHED_RIGHT_PAREN_ORD - Static variable in class gnu.regexp.RESyntax
Syntax bit.
RE(Object) - Constructor for class gnu.regexp.RE
Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
RE(Object, int) - Constructor for class gnu.regexp.RE
Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
RE(Object, int, RESyntax) - Constructor for class gnu.regexp.RE
Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.
read() - Method in class gnu.regexp.REFilterInputStream
Deprecated. Reads the next byte from the stream per the general contract of InputStream.read().
read() - Method in class gnu.regexp.REFilterReader
Reads the next character from the stream per the general contract of Reader.read().
read(byte[]) - Method in class gnu.regexp.REFilterInputStream
Deprecated. Reads from the stream into the provided array.
read(byte[], int, int) - Method in class gnu.regexp.REFilterInputStream
Deprecated. Reads from the stream into the provided array.
read(char[]) - Method in class gnu.regexp.REFilterReader
Reads from the stream into the provided array.
read(char[], int, int) - Method in class gnu.regexp.REFilterReader
Reads from the stream into the provided array.
REApplet - class gnu.regexp.util.REApplet.
This is a simple applet to demonstrate the capabilities of gnu.regexp.
REApplet() - Constructor for class gnu.regexp.util.REApplet
Creates an REApplet.
REException - exception gnu.regexp.REException.
This is the regular expression exception class.
REFilterInputStream - class gnu.regexp.REFilterInputStream.
Deprecated. This class cannot properly handle all character encodings. For proper handling, use the REFilterReader class instead.
REFilterInputStream(InputStream, RE, String) - Constructor for class gnu.regexp.REFilterInputStream
Deprecated. Creates an REFilterInputStream.
REFilterReader - class gnu.regexp.REFilterReader.
Replaces instances of a given RE with replacement text.
REFilterReader(Reader, RE, String) - Constructor for class gnu.regexp.REFilterReader
Creates an REFilterReader.
REG_ANCHORINDEX - Static variable in class gnu.regexp.RE
Execution flag.
REG_BADBR - Static variable in class gnu.regexp.REException
Error flag.
REG_BADPAT - Static variable in class gnu.regexp.REException
Error flag.
REG_BADRPT - Static variable in class gnu.regexp.REException
Error flag.
REG_DOT_NEWLINE - Static variable in class gnu.regexp.RE
Compilation flag.
REG_EBRACE - Static variable in class gnu.regexp.REException
Error flag.
REG_EBRACK - Static variable in class gnu.regexp.REException
Error flag.
REG_ECTYPE - Static variable in class gnu.regexp.REException
Error flag.
REG_EEND - Static variable in class gnu.regexp.REException
Error flag.
REG_EPAREN - Static variable in class gnu.regexp.REException
Error flag.
REG_ERANGE - Static variable in class gnu.regexp.REException
Error flag.
REG_ESCAPE - Static variable in class gnu.regexp.REException
Error flag.
REG_ESIZE - Static variable in class gnu.regexp.REException
Error flag.
REG_ESPACE - Static variable in class gnu.regexp.REException
Error flag.
REG_ESUBREG - Static variable in class gnu.regexp.REException
Error flag.
REG_ICASE - Static variable in class gnu.regexp.RE
Compilation flag.
REG_MULTILINE - Static variable in class gnu.regexp.RE
Compilation flag.
REG_NO_INTERPOLATE - Static variable in class gnu.regexp.RE
Execution flag.
REG_NOTBOL - Static variable in class gnu.regexp.RE
Execution flag.
REG_NOTEOL - Static variable in class gnu.regexp.RE
Execution flag.
REMatch - class gnu.regexp.REMatch.
An instance of this class represents a match completed by a gnu.regexp matching function.
REMatchEnumeration - class gnu.regexp.REMatchEnumeration.
An REMatchEnumeration enumerates regular expression matches over a given input text.
RESyntax - class gnu.regexp.RESyntax.
An RESyntax specifies the way a regular expression will be compiled.
RESyntax() - Constructor for class gnu.regexp.RESyntax
Construct a new syntax object with all bits turned off.
RESyntax(RESyntax) - Constructor for class gnu.regexp.RESyntax
Construct a new syntax object with all bits set the same as the other syntax.
RETest - class gnu.regexp.util.RETest.
RETest provides a simple way to test regular expressions.

S

set(int) - Method in class gnu.regexp.RESyntax
Set a given bit in this syntax.
setLineSeparator(String) - Method in class gnu.regexp.RESyntax
Changes the line separator string for regular expressions created using this RESyntax.
substitute(Object, String) - Method in class gnu.regexp.RE
Substitutes the replacement text for the first match found in the input.
substitute(Object, String, int) - Method in class gnu.regexp.RE
Substitutes the replacement text for the first match found in the input beginning at the specified index position.
substitute(Object, String, int, int) - Method in class gnu.regexp.RE
Substitutes the replacement text for the first match found in the input string, beginning at the specified index position and using the specified execution flags.
substituteAll(Object, String) - Method in class gnu.regexp.RE
Substitutes the replacement text for each non-overlapping match found in the input text.
substituteAll(Object, String, int) - Method in class gnu.regexp.RE
Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index.
substituteAll(Object, String, int, int) - Method in class gnu.regexp.RE
Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index and using the specified execution flags.
substituteInto(String) - Method in class gnu.regexp.REMatch
Substitute the results of this match to create a new string.

T

Tests - class gnu.regexp.util.Tests.
This is a very basic testsuite application for gnu.regexp.
toString() - Method in class gnu.regexp.REMatch
Returns the string matching the pattern.
toString() - Method in class gnu.regexp.RE
Return a human readable form of the compiled regular expression, useful for debugging.
toString(int) - Method in class gnu.regexp.REMatch
Returns the string matching the given subexpression.

U

UncheckedRE - class gnu.regexp.UncheckedRE.
UncheckedRE is a subclass of RE that allows programmers an easier means of programmatically precompiling regular expressions.
UncheckedRE(Object) - Constructor for class gnu.regexp.UncheckedRE
Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
UncheckedRE(Object, int) - Constructor for class gnu.regexp.UncheckedRE
Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
UncheckedRE(Object, int, RESyntax) - Constructor for class gnu.regexp.UncheckedRE
Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.

V

version() - Static method in class gnu.regexp.RE
Returns a string representing the version of the gnu.regexp package.

A C E G H I M N O R S T U V

libgnu-regexp-java-1.1.4/docs/api/index.html0100644000175000000620000000137007364636621020063 0ustar killerstaff Generated Documentation (Untitled) <H2> Frame Alert</H2> <P> This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. <BR> Link to <A HREF="overview-summary.html">Non-frame version.</A> libgnu-regexp-java-1.1.4/docs/api/overview-frame.html0100644000175000000620000000171207364636622021713 0ustar killerstaff : Overview
All Classes

Packages
gnu.regexp
gnu.regexp.util

  libgnu-regexp-java-1.1.4/docs/api/overview-summary.html0100644000175000000620000001013307364636622022313 0ustar killerstaff : Overview


Packages
gnu.regexp  
gnu.regexp.util  

 



libgnu-regexp-java-1.1.4/docs/api/overview-tree.html0100644000175000000620000001426707364636622021571 0ustar killerstaff : Class Hierarchy

Hierarchy For All Packages

Package Hierarchies:
gnu.regexp, gnu.regexp.util

Class Hierarchy

  • class java.lang.Object
    • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable)
      • class java.awt.Container
        • class java.awt.Panel (implements javax.accessibility.Accessible)
          • class java.applet.Applet
    • class gnu.regexp.util.Egrep
    • class gnu.regexp.util.Grep
    • class java.io.InputStream
    • class java.io.Reader
    • class gnu.regexp.REMatch (implements java.lang.Cloneable, java.io.Serializable)
    • class gnu.regexp.REMatchEnumeration (implements java.util.Enumeration, java.io.Serializable)
    • class gnu.regexp.RESyntax (implements java.io.Serializable)
    • class gnu.regexp.util.RETest
    • class gnu.regexp.REToken (implements java.io.Serializable)
    • class gnu.regexp.util.Tests
    • class java.lang.Throwable (implements java.io.Serializable)
      • class java.lang.Exception

Interface Hierarchy



libgnu-regexp-java-1.1.4/docs/api/package-list0100644000175000000620000000003307313463102020332 0ustar killerstaffgnu.regexp gnu.regexp.util libgnu-regexp-java-1.1.4/docs/api/packages.html0100644000175000000620000000120507364636622020530 0ustar killerstaff


The front page has been relocated.Please see:
          Frame version
          Non-frame version.
libgnu-regexp-java-1.1.4/docs/api/serialized-form.html0100644000175000000620000002431107364636622022051 0ustar killerstaff Serialized Form

Serialized Form


Package gnu.regexp

Class gnu.regexp.RE implements Serializable

Serialized Fields

firstToken

gnu.regexp.REToken firstToken

lastToken

gnu.regexp.REToken lastToken

numSubs

int numSubs

minimumLength

int minimumLength
Minimum length, in characters, of any possible match.

Class gnu.regexp.REException implements Serializable

Serialized Fields

type

int type

pos

int pos

Class gnu.regexp.REMatch implements Serializable

Serialized Fields

matchedText

java.lang.String matchedText

eflags

int eflags

offset

int offset

anchor

int anchor

index

int index

start

int[] start

end

int[] end

next

REMatch next

Class gnu.regexp.REMatchEnumeration implements Serializable

Serialized Fields

more

int more

match

REMatch match

expr

RE expr

input

CharIndexed input

eflags

int eflags

index

int index

Class gnu.regexp.RESyntax implements Serializable

Serialized Fields

bits

java.util.BitSet bits

isFinal

boolean isFinal

lineSeparator

java.lang.String lineSeparator

Class gnu.regexp.UncheckedRE implements Serializable


Package gnu.regexp.util

Class gnu.regexp.util.REApplet implements Serializable

Serialized Fields

l1

java.awt.Label l1

l2

java.awt.Label l2

l3

java.awt.Label l3

l4

java.awt.Label l4

b

java.awt.Button b

tf

java.awt.TextField tf

input

java.awt.TextArea input

output

java.awt.TextArea output

insens

java.awt.Checkbox insens

syntax

java.awt.Choice syntax



libgnu-regexp-java-1.1.4/docs/api/stylesheet.css0100644000175000000620000000233007313463102020750 0ustar killerstaff/* Javadoc style sheet */ /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Table colors */ .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: normal; font-family: normal } .FrameHeadingFont { font-size: normal; font-family: normal } .FrameItemFont { font-size: normal; font-family: normal } /* Example of smaller, sans-serif font in frames */ /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} libgnu-regexp-java-1.1.4/docs/api/gnu/0042755000175000000620000000000007617541044016656 5ustar killerstafflibgnu-regexp-java-1.1.4/docs/api/gnu/regexp/0042755000175000000620000000000007617541044020150 5ustar killerstafflibgnu-regexp-java-1.1.4/docs/api/gnu/regexp/RE.html0100644000175000000620000013547307364636622021362 0ustar killerstaff : Class RE

gnu.regexp
Class RE

java.lang.Object
  |
  +--gnu.regexp.REToken
        |
        +--gnu.regexp.RE
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
UncheckedRE

public class RE
extends gnu.regexp.REToken

RE provides the user interface for compiling and matching regular expressions.

A regular expression object (class RE) is compiled by constructing it from a String, StringBuffer or character array, with optional compilation flags (below) and an optional syntax specification (see RESyntax; if not specified, RESyntax.RE_SYNTAX_PERL5 is used).

Various methods attempt to match input text against a compiled regular expression. These methods are:

  • isMatch: returns true if the input text in its entirety matches the regular expression pattern.
  • getMatch: returns the first match found in the input text, or null if no match is found.
  • getAllMatches: returns an array of all non-overlapping matches found in the input text. If no matches are found, the array is zero-length.
  • substitute: substitute the first occurence of the pattern in the input text with a replacement string (which may include metacharacters $0-$9, see REMatch.substituteInto).
  • substituteAll: same as above, but repeat for each match before returning.
  • getMatchEnumeration: returns an REMatchEnumeration object that allows iteration over the matches (see REMatchEnumeration for some reasons why you may want to do this instead of using getAllMatches.

    These methods all have similar argument lists. The input can be a String, a character array, a StringBuffer, a Reader or an InputStream of some sort. Note that when using a Reader or InputStream, the stream read position cannot be guaranteed after attempting a match (this is not a bug, but a consequence of the way regular expressions work). Using an REMatchEnumeration can eliminate most positioning problems.

    The optional index argument specifies the offset from the beginning of the text at which the search should start (see the descriptions of some of the execution flags for how this can affect positional pattern operators). For a Reader or InputStream, this means an offset from the current read position, so subsequent calls with the same index argument on a Reader or an InputStream will not necessarily access the same position on the stream, whereas repeated searches at a given index in a fixed string will return consistent results.

    You can optionally affect the execution environment by using a combination of execution flags (constants listed below).

    All operations on a regular expression are performed in a thread-safe manner.

    Version:
    1.1.4-dev, to be released
    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Field Summary
    static int REG_ANCHORINDEX
              Execution flag.
    static int REG_DOT_NEWLINE
              Compilation flag.
    static int REG_ICASE
              Compilation flag.
    static int REG_MULTILINE
              Compilation flag.
    static int REG_NO_INTERPOLATE
              Execution flag.
    static int REG_NOTBOL
              Execution flag.
    static int REG_NOTEOL
              Execution flag.
     
    Constructor Summary
    RE(java.lang.Object pattern)
              Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
    RE(java.lang.Object pattern, int cflags)
              Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
    RE(java.lang.Object pattern, int cflags, RESyntax syntax)
              Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.
     
    Method Summary
     REMatch[] getAllMatches(java.lang.Object input)
              Returns an array of all matches found in the input.
     REMatch[] getAllMatches(java.lang.Object input, int index)
              Returns an array of all matches found in the input, beginning at the specified index position.
     REMatch[] getAllMatches(java.lang.Object input, int index, int eflags)
              Returns an array of all matches found in the input string, beginning at the specified index position and using the specified execution flags.
     REMatch getMatch(java.lang.Object input)
              Returns the first match found in the input.
     REMatch getMatch(java.lang.Object input, int index)
              Returns the first match found in the input, beginning the search at the specified index.
     REMatch getMatch(java.lang.Object input, int index, int eflags)
              Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags.
     REMatch getMatch(java.lang.Object input, int index, int eflags, java.lang.StringBuffer buffer)
              Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags.
     REMatchEnumeration getMatchEnumeration(java.lang.Object input)
              Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
     REMatchEnumeration getMatchEnumeration(java.lang.Object input, int index)
              Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
     REMatchEnumeration getMatchEnumeration(java.lang.Object input, int index, int eflags)
              Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
     int getMinimumLength()
              Returns the minimum number of characters that could possibly constitute a match of this regular expression.
     int getNumSubs()
              Returns the maximum number of subexpressions in this regular expression.
     boolean isMatch(java.lang.Object input)
              Checks if the regular expression matches the input in its entirety.
     boolean isMatch(java.lang.Object input, int index)
              Checks if the input string, starting from index, is an exact match of this regular expression.
     boolean isMatch(java.lang.Object input, int index, int eflags)
              Checks if the input, starting from index and using the specified execution flags, is an exact match of this regular expression.
     java.lang.String substitute(java.lang.Object input, java.lang.String replace)
              Substitutes the replacement text for the first match found in the input.
     java.lang.String substitute(java.lang.Object input, java.lang.String replace, int index)
              Substitutes the replacement text for the first match found in the input beginning at the specified index position.
     java.lang.String substitute(java.lang.Object input, java.lang.String replace, int index, int eflags)
              Substitutes the replacement text for the first match found in the input string, beginning at the specified index position and using the specified execution flags.
     java.lang.String substituteAll(java.lang.Object input, java.lang.String replace)
              Substitutes the replacement text for each non-overlapping match found in the input text.
     java.lang.String substituteAll(java.lang.Object input, java.lang.String replace, int index)
              Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index.
     java.lang.String substituteAll(java.lang.Object input, java.lang.String replace, int index, int eflags)
              Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index and using the specified execution flags.
     java.lang.String toString()
              Return a human readable form of the compiled regular expression, useful for debugging.
    static java.lang.String version()
              Returns a string representing the version of the gnu.regexp package.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    REG_ICASE

    public static final int REG_ICASE
    Compilation flag. Do not differentiate case. Subsequent searches using this RE will be case insensitive.

    REG_DOT_NEWLINE

    public static final int REG_DOT_NEWLINE
    Compilation flag. The match-any-character operator (dot) will match a newline character. When set this overrides the syntax bit RE_DOT_NEWLINE (see RESyntax for details). This is equivalent to the "/s" operator in Perl.

    REG_MULTILINE

    public static final int REG_MULTILINE
    Compilation flag. Use multiline mode. In this mode, the ^ and $ anchors will match based on newlines within the input. This is equivalent to the "/m" operator in Perl.

    REG_NOTBOL

    public static final int REG_NOTBOL
    Execution flag. The match-beginning operator (^) will not match at the beginning of the input string. Useful for matching on a substring when you know the context of the input is such that position zero of the input to the match test is not actually position zero of the text.

    This example demonstrates the results of various ways of matching on a substring.

    String s = "food bar fool";
    RE exp = new RE("^foo.");
    REMatch m0 = exp.getMatch(s);
    REMatch m1 = exp.getMatch(s.substring(8));
    REMatch m2 = exp.getMatch(s.substring(8),0,RE.REG_NOTBOL);
    REMatch m3 = exp.getMatch(s,8);
    REMatch m4 = exp.getMatch(s,8,RE.REG_ANCHORINDEX);

    // Results:
    // m0 = "food"
    // m1 = "fool"
    // m2 = null
    // m3 = null
    // m4 = "fool"


    REG_NOTEOL

    public static final int REG_NOTEOL
    Execution flag. The match-end operator ($) does not match at the end of the input string. Useful for matching on substrings.

    REG_ANCHORINDEX

    public static final int REG_ANCHORINDEX
    Execution flag. When a match method is invoked that starts matching at a non-zero index into the input, treat the input as if it begins at the index given. The effect of this flag is that the engine does not "see" any text in the input before the given index. This is useful so that the match-beginning operator (^) matches not at position 0 in the input string, but at the position the search started at (based on the index input given to the getMatch function). See the example under REG_NOTBOL. It also affects the use of the \< and \b operators.

    REG_NO_INTERPOLATE

    public static final int REG_NO_INTERPOLATE
    Execution flag. The substitute and substituteAll methods will not attempt to interpolate occurrences of $1-$9 in the replacement text with the corresponding subexpressions. For example, you may want to replace all matches of "one dollar" with "$1".
    Constructor Detail

    RE

    public RE(java.lang.Object pattern)
       throws REException
    Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer or char[]. Other input types will be converted to strings using the toString() method.
    Throws:
    REException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.

    RE

    public RE(java.lang.Object pattern,
              int cflags)
       throws REException
    Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer, or char[]. Other input types will be converted to strings using the toString() method.
    cflags - The logical OR of any combination of the compilation flags listed above.
    Throws:
    REException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.

    RE

    public RE(java.lang.Object pattern,
              int cflags,
              RESyntax syntax)
       throws REException
    Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer, or char[]. Other input types will be converted to strings using the toString() method.
    cflags - The logical OR of any combination of the compilation flags listed above.
    syntax - The type of regular expression syntax to use.
    Throws:
    REException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.
    Method Detail

    version

    public static final java.lang.String version()
    Returns a string representing the version of the gnu.regexp package.

    isMatch

    public boolean isMatch(java.lang.Object input)
    Checks if the regular expression matches the input in its entirety.
    Parameters:
    input - The input text.

    isMatch

    public boolean isMatch(java.lang.Object input,
                           int index)
    Checks if the input string, starting from index, is an exact match of this regular expression.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.

    isMatch

    public boolean isMatch(java.lang.Object input,
                           int index,
                           int eflags)
    Checks if the input, starting from index and using the specified execution flags, is an exact match of this regular expression.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.

    getNumSubs

    public int getNumSubs()
    Returns the maximum number of subexpressions in this regular expression. If the expression contains branches, the value returned will be the maximum subexpressions in any of the branches.

    getMinimumLength

    public int getMinimumLength()
    Returns the minimum number of characters that could possibly constitute a match of this regular expression.

    getAllMatches

    public REMatch[] getAllMatches(java.lang.Object input)
    Returns an array of all matches found in the input. If the regular expression allows the empty string to match, it will substitute matches at all positions except the end of the input.
    Parameters:
    input - The input text.
    Returns:
    a non-null (but possibly zero-length) array of matches

    getAllMatches

    public REMatch[] getAllMatches(java.lang.Object input,
                                   int index)
    Returns an array of all matches found in the input, beginning at the specified index position. If the regular expression allows the empty string to match, it will substitute matches at all positions except the end of the input.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    Returns:
    a non-null (but possibly zero-length) array of matches

    getAllMatches

    public REMatch[] getAllMatches(java.lang.Object input,
                                   int index,
                                   int eflags)
    Returns an array of all matches found in the input string, beginning at the specified index position and using the specified execution flags. If the regular expression allows the empty string to match, it will substitute matches at all positions except the end of the input.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    Returns:
    a non-null (but possibly zero-length) array of matches

    getMatch

    public REMatch getMatch(java.lang.Object input)
    Returns the first match found in the input. If no match is found, null is returned.
    Parameters:
    input - The input text.
    Returns:
    An REMatch instance referencing the match, or null if none.

    getMatch

    public REMatch getMatch(java.lang.Object input,
                            int index)
    Returns the first match found in the input, beginning the search at the specified index. If no match is found, returns null.
    Parameters:
    input - The input text.
    index - The offset within the text to begin looking for a match.
    Returns:
    An REMatch instance referencing the match, or null if none.

    getMatch

    public REMatch getMatch(java.lang.Object input,
                            int index,
                            int eflags)
    Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags. If no match is found, returns null.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    Returns:
    An REMatch instance referencing the match, or null if none.

    getMatch

    public REMatch getMatch(java.lang.Object input,
                            int index,
                            int eflags,
                            java.lang.StringBuffer buffer)
    Returns the first match found in the input, beginning the search at the specified index, and using the specified execution flags. If no match is found, returns null. If a StringBuffer is provided and is non-null, the contents of the input text from the index to the beginning of the match (or to the end of the input, if there is no match) are appended to the StringBuffer.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    buffer - The StringBuffer to save pre-match text in.
    Returns:
    An REMatch instance referencing the match, or null if none.

    getMatchEnumeration

    public REMatchEnumeration getMatchEnumeration(java.lang.Object input)
    Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
    Parameters:
    input - The input text.
    Returns:
    A non-null REMatchEnumeration instance.

    getMatchEnumeration

    public REMatchEnumeration getMatchEnumeration(java.lang.Object input,
                                                  int index)
    Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    Returns:
    A non-null REMatchEnumeration instance, with its input cursor set to the index position specified.

    getMatchEnumeration

    public REMatchEnumeration getMatchEnumeration(java.lang.Object input,
                                                  int index,
                                                  int eflags)
    Returns an REMatchEnumeration that can be used to iterate over the matches found in the input text.
    Parameters:
    input - The input text.
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    Returns:
    A non-null REMatchEnumeration instance, with its input cursor set to the index position specified.

    substitute

    public java.lang.String substitute(java.lang.Object input,
                                       java.lang.String replace)
    Substitutes the replacement text for the first match found in the input.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    Returns:
    A String interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    substitute

    public java.lang.String substitute(java.lang.Object input,
                                       java.lang.String replace,
                                       int index)
    Substitutes the replacement text for the first match found in the input beginning at the specified index position. Specifying an index effectively causes the regular expression engine to throw away the specified number of characters.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    index - The offset index at which the search should be begin.
    Returns:
    A String containing the substring of the input, starting at the index position, and interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    substitute

    public java.lang.String substitute(java.lang.Object input,
                                       java.lang.String replace,
                                       int index,
                                       int eflags)
    Substitutes the replacement text for the first match found in the input string, beginning at the specified index position and using the specified execution flags.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    Returns:
    A String containing the substring of the input, starting at the index position, and interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    substituteAll

    public java.lang.String substituteAll(java.lang.Object input,
                                          java.lang.String replace)
    Substitutes the replacement text for each non-overlapping match found in the input text.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    Returns:
    A String interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    substituteAll

    public java.lang.String substituteAll(java.lang.Object input,
                                          java.lang.String replace,
                                          int index)
    Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index. If the regular expression allows the empty string to match, it will substitute matches at all positions except the end of the input.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    index - The offset index at which the search should be begin.
    Returns:
    A String containing the substring of the input, starting at the index position, and interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    substituteAll

    public java.lang.String substituteAll(java.lang.Object input,
                                          java.lang.String replace,
                                          int index,
                                          int eflags)
    Substitutes the replacement text for each non-overlapping match found in the input text, starting at the specified index and using the specified execution flags.
    Parameters:
    input - The input text.
    replace - The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
    index - The offset index at which the search should be begin.
    eflags - The logical OR of any execution flags above.
    Returns:
    A String containing the substring of the input, starting at the index position, and interpolating the substituted text.
    See Also:
    REMatch.substituteInto(java.lang.String)

    toString

    public java.lang.String toString()
    Return a human readable form of the compiled regular expression, useful for debugging.
    Overrides:
    toString in class java.lang.Object


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/REException.html0100644000175000000620000004076407364636622023237 0ustar killerstaff : Class REException

    gnu.regexp
    Class REException

    java.lang.Object
      |
      +--java.lang.Throwable
            |
            +--java.lang.Exception
                  |
                  +--gnu.regexp.REException
    
    All Implemented Interfaces:
    java.io.Serializable

    public class REException
    extends java.lang.Exception

    This is the regular expression exception class. An exception of this type defines the three attributes:

    1. A descriptive message of the error.
    2. An integral type code equivalent to one of the statically defined symbols listed below.
    3. The approximate position in the input string where the error occurred.

    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Field Summary
    static int REG_BADBR
              Error flag.
    static int REG_BADPAT
              Error flag.
    static int REG_BADRPT
              Error flag.
    static int REG_EBRACE
              Error flag.
    static int REG_EBRACK
              Error flag.
    static int REG_ECTYPE
              Error flag.
    static int REG_EEND
              Error flag.
    static int REG_EPAREN
              Error flag.
    static int REG_ERANGE
              Error flag.
    static int REG_ESCAPE
              Error flag.
    static int REG_ESIZE
              Error flag.
    static int REG_ESPACE
              Error flag.
    static int REG_ESUBREG
              Error flag.
     
    Method Summary
     java.lang.String getMessage()
              Reports the descriptive message associated with this exception as well as its index position in the string or character array being compiled.
     int getPosition()
              Returns the position, relative to the string or character array being compiled, where the error occurred.
     int getType()
              Returns the type of the exception, one of the constants listed above.
     
    Methods inherited from class java.lang.Throwable
    fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    REG_BADRPT

    public static final int REG_BADRPT
    Error flag. Invalid use of repetition operators such as using `*' as the first character.

    REG_BADBR

    public static final int REG_BADBR
    Error flag. Invalid use of back reference operator.

    REG_EBRACE

    public static final int REG_EBRACE
    Error flag. Un-matched brace interval operators.

    REG_EBRACK

    public static final int REG_EBRACK
    Error flag. Un-matched bracket list operators.

    REG_ERANGE

    public static final int REG_ERANGE
    Error flag. Invalid use of the range operator, eg. the ending point of the range occurs prior to the starting point.

    REG_ECTYPE

    public static final int REG_ECTYPE
    Error flag. Unknown character class name. Not implemented.

    REG_EPAREN

    public static final int REG_EPAREN
    Error flag. Un-matched parenthesis group operators.

    REG_ESUBREG

    public static final int REG_ESUBREG
    Error flag. Invalid back reference to a subexpression.

    REG_EEND

    public static final int REG_EEND
    Error flag. Non specific error. Not implemented.

    REG_ESCAPE

    public static final int REG_ESCAPE
    Error flag. Invalid escape sequence. Not implemented.

    REG_BADPAT

    public static final int REG_BADPAT
    Error flag. Invalid use of pattern operators such as group or list.

    REG_ESIZE

    public static final int REG_ESIZE
    Error flag. Compiled regular expression requires a pattern buffer larger than 64Kb. Not implemented.

    REG_ESPACE

    public static final int REG_ESPACE
    Error flag. The regex routines ran out of memory. Not implemented.
    Method Detail

    getType

    public int getType()
    Returns the type of the exception, one of the constants listed above.

    getPosition

    public int getPosition()
    Returns the position, relative to the string or character array being compiled, where the error occurred. This position is generally the point where the error was detected, not necessarily the starting index of a bad subexpression.

    getMessage

    public java.lang.String getMessage()
    Reports the descriptive message associated with this exception as well as its index position in the string or character array being compiled.
    Overrides:
    getMessage in class java.lang.Throwable


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/REFilterInputStream.html0100644000175000000620000003020107364636622024703 0ustar killerstaff : Class REFilterInputStream

    gnu.regexp
    Class REFilterInputStream

    java.lang.Object
      |
      +--java.io.InputStream
            |
            +--java.io.FilterInputStream
                  |
                  +--gnu.regexp.REFilterInputStream
    

    Deprecated. This class cannot properly handle all character encodings. For proper handling, use the REFilterReader class instead.

    public class REFilterInputStream
    extends java.io.FilterInputStream

    Replaces instances of a given RE found within an InputStream with replacement text. The replacements are interpolated into the stream when a match is found.

    Author:
    Wes Biggs

    Constructor Summary
    REFilterInputStream(java.io.InputStream stream, RE expr, java.lang.String replace)
              Deprecated. Creates an REFilterInputStream.
     
    Method Summary
     boolean markSupported()
              Deprecated. Returns false.
     int read()
              Deprecated. Reads the next byte from the stream per the general contract of InputStream.read().
     int read(byte[] b)
              Deprecated. Reads from the stream into the provided array.
     int read(byte[] b, int off, int len)
              Deprecated. Reads from the stream into the provided array.
     
    Methods inherited from class java.io.FilterInputStream
    available, close, mark, reset, skip
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    REFilterInputStream

    public REFilterInputStream(java.io.InputStream stream,
                               RE expr,
                               java.lang.String replace)
    Deprecated. 
    Creates an REFilterInputStream. When reading from this stream, occurrences of patterns matching the supplied regular expression will be replaced with the supplied replacement text (the metacharacters $0 through $9 may be used to refer to the full match or subexpression matches).
    Parameters:
    stream - The InputStream to be filtered.
    expr - The regular expression to search for.
    replace - The text pattern to replace matches with.
    Method Detail

    read

    public int read()
    Deprecated. 
    Reads the next byte from the stream per the general contract of InputStream.read(). Returns -1 on error or end of stream.
    Overrides:
    read in class java.io.FilterInputStream

    markSupported

    public boolean markSupported()
    Deprecated. 
    Returns false. REFilterInputStream does not support mark() and reset() methods.
    Overrides:
    markSupported in class java.io.FilterInputStream

    read

    public int read(byte[] b,
                    int off,
                    int len)
    Deprecated. 
    Reads from the stream into the provided array.
    Overrides:
    read in class java.io.FilterInputStream

    read

    public int read(byte[] b)
    Deprecated. 
    Reads from the stream into the provided array.
    Overrides:
    read in class java.io.FilterInputStream


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/REMatch.html0100644000175000000620000003650007364636622022326 0ustar killerstaff : Class REMatch

    gnu.regexp
    Class REMatch

    java.lang.Object
      |
      +--gnu.regexp.REMatch
    
    All Implemented Interfaces:
    java.lang.Cloneable, java.io.Serializable

    public final class REMatch
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

    An instance of this class represents a match completed by a gnu.regexp matching function. It can be used to obtain relevant information about the location of a match or submatch.

    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Method Summary
     java.lang.Object clone()
               
     int getEndIndex()
              Returns the index within the input string where the match in its entirety ends.
     int getEndIndex(int sub)
              Returns the index within the input string used to generate this match where subexpression number sub ends, or -1 if the subexpression does not exist.
     int getStartIndex()
              Returns the index within the input text where the match in its entirety began.
     int getStartIndex(int sub)
              Returns the index within the input string used to generate this match where subexpression number sub begins, or -1 if the subexpression does not exist.
     int getSubEndIndex(int sub)
              Deprecated. Use getEndIndex(int) instead
     int getSubStartIndex(int sub)
              Deprecated. Use getStartIndex(int) instead.
     java.lang.String substituteInto(java.lang.String input)
              Substitute the results of this match to create a new string.
     java.lang.String toString()
              Returns the string matching the pattern.
     java.lang.String toString(int sub)
              Returns the string matching the given subexpression.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Method Detail

    clone

    public java.lang.Object clone()

    toString

    public java.lang.String toString()
    Returns the string matching the pattern. This makes it convenient to write code like the following:

    REMatch myMatch = myExpression.getMatch(myString);
    if (myMatch != null) System.out.println("Regexp found: "+myMatch);

    Overrides:
    toString in class java.lang.Object

    getStartIndex

    public int getStartIndex()
    Returns the index within the input text where the match in its entirety began.

    getEndIndex

    public int getEndIndex()
    Returns the index within the input string where the match in its entirety ends. The return value is the next position after the end of the string; therefore, a match created by the following call:

    REMatch myMatch = myExpression.getMatch(myString);

    can be viewed (given that myMatch is not null) by creating

    String theMatch = myString.substring(myMatch.getStartIndex(), myMatch.getEndIndex());

    But you can save yourself that work, since the toString() method (above) does exactly that for you.


    toString

    public java.lang.String toString(int sub)
    Returns the string matching the given subexpression. The subexpressions are indexed starting with one, not zero. That is, the subexpression identified by the first set of parentheses in a regular expression could be retrieved from an REMatch by calling match.toString(1).
    Parameters:
    sub - Index of the subexpression.

    getSubStartIndex

    public int getSubStartIndex(int sub)
    Deprecated. Use getStartIndex(int) instead.

    Returns the index within the input string used to generate this match where subexpression number sub begins, or -1 if the subexpression does not exist. The initial position is zero.
    Parameters:
    sub - Subexpression index

    getStartIndex

    public int getStartIndex(int sub)
    Returns the index within the input string used to generate this match where subexpression number sub begins, or -1 if the subexpression does not exist. The initial position is zero.
    Parameters:
    sub - Subexpression index
    Since:
    gnu.regexp 1.1.0

    getSubEndIndex

    public int getSubEndIndex(int sub)
    Deprecated. Use getEndIndex(int) instead

    Returns the index within the input string used to generate this match where subexpression number sub ends, or -1 if the subexpression does not exist. The initial position is zero.
    Parameters:
    sub - Subexpression index

    getEndIndex

    public int getEndIndex(int sub)
    Returns the index within the input string used to generate this match where subexpression number sub ends, or -1 if the subexpression does not exist. The initial position is zero.
    Parameters:
    sub - Subexpression index

    substituteInto

    public java.lang.String substituteInto(java.lang.String input)
    Substitute the results of this match to create a new string. This is patterned after PERL, so the tokens to watch out for are $0 through $9. $0 matches the full substring matched; $n matches subexpression number n.
    Parameters:
    input - A string consisting of literals and $n tokens.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/REMatchEnumeration.html0100644000175000000620000002614507364636622024541 0ustar killerstaff : Class REMatchEnumeration

    gnu.regexp
    Class REMatchEnumeration

    java.lang.Object
      |
      +--gnu.regexp.REMatchEnumeration
    
    All Implemented Interfaces:
    java.util.Enumeration, java.io.Serializable

    public class REMatchEnumeration
    extends java.lang.Object
    implements java.util.Enumeration, java.io.Serializable

    An REMatchEnumeration enumerates regular expression matches over a given input text. You obtain a reference to an enumeration using the getMatchEnumeration() methods on an instance of RE.

    REMatchEnumeration does lazy computation; that is, it will not search for a match until it needs to. If you'd rather just get all the matches at once in a big array, use the getAllMatches() methods on RE. However, using an enumeration can help speed performance when the entire text does not need to be searched immediately.

    The enumerated type is especially useful when searching on a Reader or InputStream, because the InputStream read position cannot be guaranteed after calling getMatch() (see the description of that method for an explanation of why). Enumeration also saves a lot of overhead required when calling getMatch() multiple times.

    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Method Summary
     boolean hasMoreElements()
              Returns true if there are more matches in the input text.
     boolean hasMoreMatches()
              Returns true if there are more matches in the input text.
     boolean hasMoreMatches(java.lang.StringBuffer buffer)
              Returns true if there are more matches in the input text.
     java.lang.Object nextElement()
              Returns the next match in the input text.
     REMatch nextMatch()
              Returns the next match in the input text.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    hasMoreElements

    public boolean hasMoreElements()
    Returns true if there are more matches in the input text.
    Specified by:
    hasMoreElements in interface java.util.Enumeration

    hasMoreMatches

    public boolean hasMoreMatches()
    Returns true if there are more matches in the input text.

    hasMoreMatches

    public boolean hasMoreMatches(java.lang.StringBuffer buffer)
    Returns true if there are more matches in the input text. Saves the text leading up to the match (or to the end of the input) in the specified buffer.

    nextElement

    public java.lang.Object nextElement()
                                 throws java.util.NoSuchElementException
    Returns the next match in the input text.
    Specified by:
    nextElement in interface java.util.Enumeration

    nextMatch

    public REMatch nextMatch()
                      throws java.util.NoSuchElementException
    Returns the next match in the input text. This method is provided for convenience to avoid having to explicitly cast the return value to class REMatch.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/RESyntax.html0100644000175000000620000011514707364636622022565 0ustar killerstaff : Class RESyntax

    gnu.regexp
    Class RESyntax

    java.lang.Object
      |
      +--gnu.regexp.RESyntax
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class RESyntax
    extends java.lang.Object
    implements java.io.Serializable

    An RESyntax specifies the way a regular expression will be compiled. This class provides a number of predefined useful constants for emulating popular regular expression syntaxes. Additionally the user may construct his or her own syntax, using any combination of the syntax bit constants. The syntax is an optional argument to any of the matching methods on class RE.

    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Field Summary
    static int RE_BACKSLASH_ESCAPE_IN_LISTS
              Syntax bit.
    static int RE_BK_PLUS_QM
              Syntax bit.
    static int RE_CHAR_CLASS_ESC_IN_LISTS
              Syntax bit.
    static int RE_CHAR_CLASS_ESCAPES
              Syntax bit.
    static int RE_CHAR_CLASSES
              Syntax bit.
    static int RE_COMMENTS
              Syntax bit.
    static int RE_CONTEXT_INDEP_ANCHORS
              Syntax bit.
    static int RE_CONTEXT_INDEP_OPS
              Syntax bit.
    static int RE_CONTEXT_INVALID_OPS
              Syntax bit.
    static int RE_DOT_NEWLINE
              Syntax bit.
    static int RE_DOT_NOT_NULL
              Syntax bit.
    static int RE_HAT_LISTS_NOT_NEWLINE
              Syntax bit.
    static int RE_INTERVALS
              Syntax bit.
    static int RE_LIMITED_OPS
              Syntax bit.
    static int RE_LOOKAHEAD
              Syntax bit.
    static int RE_NEWLINE_ALT
              Syntax bit.
    static int RE_NO_BK_BRACES
              Syntax bit.
    static int RE_NO_BK_PARENS
              Syntax bit.
    static int RE_NO_BK_REFS
              Syntax bit.
    static int RE_NO_BK_VBAR
              Syntax bit.
    static int RE_NO_EMPTY_RANGES
              Syntax bit.
    static int RE_PURE_GROUPING
              Syntax bit.
    static int RE_STINGY_OPS
              Syntax bit.
    static int RE_STRING_ANCHORS
              Syntax bit.
    static RESyntax RE_SYNTAX_AWK
              Predefined syntax.
    static RESyntax RE_SYNTAX_ED
              Predefined syntax.
    static RESyntax RE_SYNTAX_EGREP
              Predefined syntax.
    static RESyntax RE_SYNTAX_EMACS
              Predefined syntax.
    static RESyntax RE_SYNTAX_GREP
              Predefined syntax.
    static RESyntax RE_SYNTAX_PERL4
              Predefined syntax.
    static RESyntax RE_SYNTAX_PERL4_S
              Predefined syntax.
    static RESyntax RE_SYNTAX_PERL5
              Predefined syntax.
    static RESyntax RE_SYNTAX_PERL5_S
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_AWK
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_BASIC
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_EGREP
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_EXTENDED
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_MINIMAL_BASIC
              Predefined syntax.
    static RESyntax RE_SYNTAX_POSIX_MINIMAL_EXTENDED
              Predefined syntax.
    static RESyntax RE_SYNTAX_SED
              Predefined syntax.
    static int RE_UNMATCHED_RIGHT_PAREN_ORD
              Syntax bit.
     
    Constructor Summary
    RESyntax()
              Construct a new syntax object with all bits turned off.
    RESyntax(RESyntax other)
              Construct a new syntax object with all bits set the same as the other syntax.
     
    Method Summary
     RESyntax clear(int index)
              Clear a given bit in this syntax.
     boolean get(int index)
              Check if a given bit is set in this syntax.
     java.lang.String getLineSeparator()
              Returns the currently active line separator string.
     RESyntax makeFinal()
              Called internally when constructing predefined syntaxes so their interpretation cannot vary.
     RESyntax set(int index)
              Set a given bit in this syntax.
     RESyntax setLineSeparator(java.lang.String aSeparator)
              Changes the line separator string for regular expressions created using this RESyntax.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    RE_BACKSLASH_ESCAPE_IN_LISTS

    public static final int RE_BACKSLASH_ESCAPE_IN_LISTS
    Syntax bit. Backslash is an escape character in lists.

    RE_BK_PLUS_QM

    public static final int RE_BK_PLUS_QM
    Syntax bit. Use \? instead of ? and \+ instead of +.

    RE_CHAR_CLASSES

    public static final int RE_CHAR_CLASSES
    Syntax bit. POSIX character classes ([:...:]) in lists are allowed.

    RE_CONTEXT_INDEP_ANCHORS

    public static final int RE_CONTEXT_INDEP_ANCHORS
    Syntax bit. ^ and $ are special everywhere. Not implemented.

    RE_CONTEXT_INDEP_OPS

    public static final int RE_CONTEXT_INDEP_OPS
    Syntax bit. Repetition operators are only special in valid positions. Not implemented.

    RE_CONTEXT_INVALID_OPS

    public static final int RE_CONTEXT_INVALID_OPS
    Syntax bit. Repetition and alternation operators are invalid at start and end of pattern and other places. Not implemented.

    RE_DOT_NEWLINE

    public static final int RE_DOT_NEWLINE
    Syntax bit. Match-any-character operator (.) matches a newline.

    RE_DOT_NOT_NULL

    public static final int RE_DOT_NOT_NULL
    Syntax bit. Match-any-character operator (.) does not match a null.

    RE_INTERVALS

    public static final int RE_INTERVALS
    Syntax bit. Intervals ({x}, {x,}, {x,y}) are allowed.

    RE_LIMITED_OPS

    public static final int RE_LIMITED_OPS
    Syntax bit. No alternation (|), match one-or-more (+), or match zero-or-one (?) operators.

    RE_NEWLINE_ALT

    public static final int RE_NEWLINE_ALT
    Syntax bit. Newline is an alternation operator.

    RE_NO_BK_BRACES

    public static final int RE_NO_BK_BRACES
    Syntax bit. Intervals use { } instead of \{ \}

    RE_NO_BK_PARENS

    public static final int RE_NO_BK_PARENS
    Syntax bit. Grouping uses ( ) instead of \( \).

    RE_NO_BK_REFS

    public static final int RE_NO_BK_REFS
    Syntax bit. Backreferences not allowed.

    RE_NO_BK_VBAR

    public static final int RE_NO_BK_VBAR
    Syntax bit. Alternation uses | instead of \|

    RE_NO_EMPTY_RANGES

    public static final int RE_NO_EMPTY_RANGES
    Syntax bit. Not implemented.

    RE_UNMATCHED_RIGHT_PAREN_ORD

    public static final int RE_UNMATCHED_RIGHT_PAREN_ORD
    Syntax bit. An unmatched right parenthesis (')' or '\)', depending on RE_NO_BK_PARENS) will throw an exception when compiling.

    RE_HAT_LISTS_NOT_NEWLINE

    public static final int RE_HAT_LISTS_NOT_NEWLINE
    Syntax bit. Not implemented.

    RE_STINGY_OPS

    public static final int RE_STINGY_OPS
    Syntax bit. Stingy matching is allowed (+?, *?, ??, {x,y}?).

    RE_CHAR_CLASS_ESCAPES

    public static final int RE_CHAR_CLASS_ESCAPES
    Syntax bit. Allow character class escapes (\d, \D, \s, \S, \w, \W).

    RE_PURE_GROUPING

    public static final int RE_PURE_GROUPING
    Syntax bit. Allow use of (?:xxx) grouping (subexpression is not saved).

    RE_LOOKAHEAD

    public static final int RE_LOOKAHEAD
    Syntax bit. Allow use of (?=xxx) and (?!xxx) apply the subexpression to the text following the current position without consuming that text.

    RE_STRING_ANCHORS

    public static final int RE_STRING_ANCHORS
    Syntax bit. Allow beginning- and end-of-string anchors (\A, \Z).

    RE_COMMENTS

    public static final int RE_COMMENTS
    Syntax bit. Allow embedded comments, (?#comment), as in Perl5.

    RE_CHAR_CLASS_ESC_IN_LISTS

    public static final int RE_CHAR_CLASS_ESC_IN_LISTS
    Syntax bit. Allow character class escapes within lists, as in Perl5.

    RE_SYNTAX_AWK

    public static final RESyntax RE_SYNTAX_AWK
    Predefined syntax. Emulates regular expression support in the awk utility.

    RE_SYNTAX_ED

    public static final RESyntax RE_SYNTAX_ED
    Predefined syntax. Emulates regular expression support in the ed utility.

    RE_SYNTAX_EGREP

    public static final RESyntax RE_SYNTAX_EGREP
    Predefined syntax. Emulates regular expression support in the egrep utility.

    RE_SYNTAX_EMACS

    public static final RESyntax RE_SYNTAX_EMACS
    Predefined syntax. Emulates regular expression support in the GNU Emacs editor.

    RE_SYNTAX_GREP

    public static final RESyntax RE_SYNTAX_GREP
    Predefined syntax. Emulates regular expression support in the grep utility.

    RE_SYNTAX_POSIX_AWK

    public static final RESyntax RE_SYNTAX_POSIX_AWK
    Predefined syntax. Emulates regular expression support in the POSIX awk specification.

    RE_SYNTAX_POSIX_BASIC

    public static final RESyntax RE_SYNTAX_POSIX_BASIC
    Predefined syntax. Emulates POSIX basic regular expression support.

    RE_SYNTAX_POSIX_EGREP

    public static final RESyntax RE_SYNTAX_POSIX_EGREP
    Predefined syntax. Emulates regular expression support in the POSIX egrep specification.

    RE_SYNTAX_POSIX_EXTENDED

    public static final RESyntax RE_SYNTAX_POSIX_EXTENDED
    Predefined syntax. Emulates POSIX extended regular expression support.

    RE_SYNTAX_POSIX_MINIMAL_BASIC

    public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_BASIC
    Predefined syntax. Emulates POSIX basic minimal regular expressions.

    RE_SYNTAX_POSIX_MINIMAL_EXTENDED

    public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_EXTENDED
    Predefined syntax. Emulates POSIX extended minimal regular expressions.

    RE_SYNTAX_SED

    public static final RESyntax RE_SYNTAX_SED
    Predefined syntax. Emulates regular expression support in the sed utility.

    RE_SYNTAX_PERL4

    public static final RESyntax RE_SYNTAX_PERL4
    Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 4,

    RE_SYNTAX_PERL4_S

    public static final RESyntax RE_SYNTAX_PERL4_S
    Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 4, using single line mode (/s modifier).

    RE_SYNTAX_PERL5

    public static final RESyntax RE_SYNTAX_PERL5
    Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 5.

    RE_SYNTAX_PERL5_S

    public static final RESyntax RE_SYNTAX_PERL5_S
    Predefined syntax. Emulates regular expression support in Larry Wall's perl, version 5, using single line mode (/s modifier).
    Constructor Detail

    RESyntax

    public RESyntax()
    Construct a new syntax object with all bits turned off. This is equivalent to RE_SYNTAX_EMACS.

    RESyntax

    public RESyntax(RESyntax other)
    Construct a new syntax object with all bits set the same as the other syntax.
    Method Detail

    makeFinal

    public RESyntax makeFinal()
    Called internally when constructing predefined syntaxes so their interpretation cannot vary. Conceivably useful for your syntaxes as well. Causes IllegalAccessError to be thrown if any attempt to modify the syntax is made.
    Returns:
    this object for convenient chaining

    get

    public boolean get(int index)
    Check if a given bit is set in this syntax.

    set

    public RESyntax set(int index)
    Set a given bit in this syntax.
    Parameters:
    index - the constant (RESyntax.RE_xxx) bit to set.
    Returns:
    a reference to this object for easy chaining.

    clear

    public RESyntax clear(int index)
    Clear a given bit in this syntax.
    Parameters:
    index - the constant (RESyntax.RE_xxx) bit to clear.
    Returns:
    a reference to this object for easy chaining.

    setLineSeparator

    public RESyntax setLineSeparator(java.lang.String aSeparator)
    Changes the line separator string for regular expressions created using this RESyntax. The default separator is the value returned by the system property "line.separator", which should be correct when reading platform-specific files from a filesystem. However, many programs may collect input from sources where the line separator is differently specified (for example, in the applet environment, the text box widget interprets line breaks as single-character newlines, regardless of the host platform. Note that setting the line separator to a character or characters that have specific meaning within the current syntax can cause unexpected chronosynclastic infundibula.
    Returns:
    this object for convenient chaining

    getLineSeparator

    public java.lang.String getLineSeparator()
    Returns the currently active line separator string. The default is the platform-dependent system property "line.separator".


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/UncheckedRE.html0100644000175000000620000003501107364637116023156 0ustar killerstaff : Class UncheckedRE

    gnu.regexp
    Class UncheckedRE

    java.lang.Object
      |
      +--gnu.regexp.REToken
            |
            +--gnu.regexp.RE
                  |
                  +--gnu.regexp.UncheckedRE
    
    All Implemented Interfaces:
    java.io.Serializable

    public final class UncheckedRE
    extends RE

    UncheckedRE is a subclass of RE that allows programmers an easier means of programmatically precompiling regular expressions. It is constructed and used in exactly the same manner as an instance of the RE class; the only difference is that its constructors do not throw REException. Instead, if a syntax error is encountered during construction, a RuntimeException will be thrown.

    Note that this makes UncheckedRE dangerous if constructed with dynamic data. Do not use UncheckedRE unless you are completely sure that all input being passed to it contains valid, well-formed regular expressions for the syntax specified.

    Since:
    gnu.regexp 1.1.4
    Author:
    Wes Biggs
    See Also:
    RE, Serialized Form

    Fields inherited from class gnu.regexp.RE
    REG_ANCHORINDEX, REG_DOT_NEWLINE, REG_ICASE, REG_MULTILINE, REG_NO_INTERPOLATE, REG_NOTBOL, REG_NOTEOL
     
    Constructor Summary
    UncheckedRE(java.lang.Object pattern)
              Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
    UncheckedRE(java.lang.Object pattern, int cflags)
              Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
    UncheckedRE(java.lang.Object pattern, int cflags, RESyntax syntax)
              Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.
     
    Methods inherited from class gnu.regexp.RE
    getAllMatches, getAllMatches, getAllMatches, getMatch, getMatch, getMatch, getMatch, getMatchEnumeration, getMatchEnumeration, getMatchEnumeration, getMinimumLength, getNumSubs, isMatch, isMatch, isMatch, substitute, substitute, substitute, substituteAll, substituteAll, substituteAll, toString, version
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    UncheckedRE

    public UncheckedRE(java.lang.Object pattern)
    Constructs a regular expression pattern buffer without any compilation flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5).
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer or char[]. Other input types will be converted to strings using the toString() method.
    Throws:
    java.lang.RuntimeException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.

    UncheckedRE

    public UncheckedRE(java.lang.Object pattern,
                       int cflags)
    Constructs a regular expression pattern buffer using the specified compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5).
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer, or char[]. Other input types will be converted to strings using the toString() method.
    cflags - The logical OR of any combination of the compilation flags in the RE class.
    Throws:
    java.lang.RuntimeException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.

    UncheckedRE

    public UncheckedRE(java.lang.Object pattern,
                       int cflags,
                       RESyntax syntax)
    Constructs a regular expression pattern buffer using the specified compilation flags and regular expression syntax.
    Parameters:
    pattern - A regular expression pattern, in the form of a String, StringBuffer, or char[]. Other input types will be converted to strings using the toString() method.
    cflags - The logical OR of any combination of the compilation flags in the RE class.
    syntax - The type of regular expression syntax to use.
    Throws:
    java.lang.RuntimeException - The input pattern could not be parsed.
    NullPointerException - The pattern was null.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/package-frame.html0100644000175000000620000000313607364636622023525 0ustar killerstaff : Package gnu.regexp gnu.regexp
    Interfaces 
    CharIndexed
    Classes 
    RE
    REFilterInputStream
    REFilterReader
    REMatch
    REMatchEnumeration
    RESyntax
    UncheckedRE
    Exceptions 
    REException
    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/package-summary.html0100644000175000000620000001470007364636622024127 0ustar killerstaff : Package gnu.regexp

    Package gnu.regexp

    Interface Summary
    CharIndexed Defines the interface used internally so that different types of source text can be accessed in the same way.
     

    Class Summary
    RE RE provides the user interface for compiling and matching regular expressions.
    REFilterInputStream Deprecated. This class cannot properly handle all character encodings.
    REFilterReader Replaces instances of a given RE with replacement text.
    REMatch An instance of this class represents a match completed by a gnu.regexp matching function.
    REMatchEnumeration An REMatchEnumeration enumerates regular expression matches over a given input text.
    RESyntax An RESyntax specifies the way a regular expression will be compiled.
    UncheckedRE UncheckedRE is a subclass of RE that allows programmers an easier means of programmatically precompiling regular expressions.
     

    Exception Summary
    REException This is the regular expression exception class.
     



    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/package-tree.html0100644000175000000620000001323507364636622023373 0ustar killerstaff : gnu.regexp Class Hierarchy

    Hierarchy For Package gnu.regexp

    Package Hierarchies:
    All Packages

    Class Hierarchy

    • class java.lang.Object
      • class java.io.InputStream
      • class java.io.Reader
      • class gnu.regexp.REMatch (implements java.lang.Cloneable, java.io.Serializable)
      • class gnu.regexp.REMatchEnumeration (implements java.util.Enumeration, java.io.Serializable)
      • class gnu.regexp.RESyntax (implements java.io.Serializable)
      • class gnu.regexp.REToken (implements java.io.Serializable)
      • class java.lang.Throwable (implements java.io.Serializable)
        • class java.lang.Exception

    Interface Hierarchy



    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/0042755000175000000620000000000007617541044021125 5ustar killerstafflibgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/Egrep.html0100644000175000000620000001626007364636622023063 0ustar killerstaff : Class Egrep

    gnu.regexp.util
    Class Egrep

    java.lang.Object
      |
      +--gnu.regexp.util.Egrep
    

    public class Egrep
    extends java.lang.Object

    This is a front end to the gnu.regexp.util.Grep class which sets the syntax used to RE_SYNTAX_EGREP, which aims to emulate the standard UNIX egrep command.

    Version:
    1.01
    Author:
    Wes Biggs

    Method Summary
    static void main(java.lang.String[] argv)
              Invokes Grep.grep() using the RE_SYNTAX_EGREP syntax and the command line arguments specified.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    main

    public static void main(java.lang.String[] argv)
    Invokes Grep.grep() using the RE_SYNTAX_EGREP syntax and the command line arguments specified. Output is sent to System.out. For a list of options, use the argument "--help".


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/Grep.html0100644000175000000620000002115307364636622022713 0ustar killerstaff : Class Grep

    gnu.regexp.util
    Class Grep

    java.lang.Object
      |
      +--gnu.regexp.util.Grep
    

    public class Grep
    extends java.lang.Object

    Grep is a pure-Java clone of the GNU grep utility. As such, it is much slower and not as full-featured, but it has the advantage of being available on any system with a Java virtual machine.

    Version:
    1.03
    Author:
    Wes Biggs Lee Sau Dan Ulf Dittmer

    Method Summary
    static int grep(java.lang.String[] argv, RESyntax syntax, java.io.PrintStream out)
              Runs Grep with the specified arguments.
    static void main(java.lang.String[] argv)
              Invokes the grep() function below with the command line arguments and using the RESyntax.RE_SYNTAX_GREP syntax, which attempts to emulate the traditional UNIX grep syntax.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    main

    public static void main(java.lang.String[] argv)
    Invokes the grep() function below with the command line arguments and using the RESyntax.RE_SYNTAX_GREP syntax, which attempts to emulate the traditional UNIX grep syntax.

    grep

    public static int grep(java.lang.String[] argv,
                           RESyntax syntax,
                           java.io.PrintStream out)
    Runs Grep with the specified arguments. For a list of supported options, specify "--help". This is the meat of the grep routine, but unlike main(), you can specify your own syntax and PrintStream to use for output.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/REApplet.html0100644000175000000620000003427407364636622023502 0ustar killerstaff : Class REApplet

    gnu.regexp.util
    Class REApplet

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--java.awt.Panel
                        |
                        +--java.applet.Applet
                              |
                              +--gnu.regexp.util.REApplet
    
    All Implemented Interfaces:
    javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

    public class REApplet
    extends java.applet.Applet

    This is a simple applet to demonstrate the capabilities of gnu.regexp. To run it, use appletviewer on the reapplet.html file included in the documentation directory.

    Version:
    1.02
    Author:
    Wes Biggs
    See Also:
    Serialized Form

    Fields inherited from class java.awt.Component
    BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
     
    Fields inherited from interface java.awt.image.ImageObserver
    ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
     
    Constructor Summary
    REApplet()
              Creates an REApplet.
     
    Method Summary
     boolean action(java.awt.Event e, java.lang.Object arg)
              Handles events in the applet.
     void init()
              Initializes the applet and constructs GUI elements.
     
    Methods inherited from class java.applet.Applet
    destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
     
    Methods inherited from class java.awt.Panel
    addNotify
     
    Methods inherited from class java.awt.Container
    add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
     
    Methods inherited from class java.awt.Component
    add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    REApplet

    public REApplet()
    Creates an REApplet.
    Method Detail

    init

    public void init()
    Initializes the applet and constructs GUI elements.
    Overrides:
    init in class java.applet.Applet

    action

    public boolean action(java.awt.Event e,
                          java.lang.Object arg)
    Handles events in the applet. Returns true if the indicated event was handled, false for all other events.
    Overrides:
    action in class java.awt.Component


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/RETest.html0100644000175000000620000002047007364636622023165 0ustar killerstaff : Class RETest

    gnu.regexp.util
    Class RETest

    java.lang.Object
      |
      +--gnu.regexp.util.RETest
    

    public class RETest
    extends java.lang.Object

    RETest provides a simple way to test regular expressions. It runs from the command line using the Java interpreter. To use it, enter the following from a command prompt (provided that the Java system knows where to find the RETest bytecodes):
    java gnu.regexp.util.RETest [regExp] [inputString]
    where regExp is a regular expression (you'll probably have to escape shell meta-characters) and inputString is the string to match against (again, put it in quotes or escape any shell meta- characters).

    The test function will report the package version number, whether the expression matches the input string, what the match it found was, and the contents of any subexpressions, if applicable.

    You may optionally add a third integer argument which is the number of times to repeat the test. When this option is used, RETest will report average compile and match times.

    Version:
    1.01
    Author:
    Wes Biggs

    Method Summary
    static void main(java.lang.String[] argv)
              Invokes the test function with the command line arguments specified.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    main

    public static void main(java.lang.String[] argv)
                     throws REException
    Invokes the test function with the command line arguments specified. See class description for usage notes.
    Parameters:
    argv - The command line arguments.
    Throws:
    REException - There was an error compiling or executing the regular expression.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/Tests.html0100644000175000000620000001622307364636622023122 0ustar killerstaff : Class Tests

    gnu.regexp.util
    Class Tests

    java.lang.Object
      |
      +--gnu.regexp.util.Tests
    

    public class Tests
    extends java.lang.Object

    This is a very basic testsuite application for gnu.regexp.

    Version:
    1.1.1
    Author:
    Wes Biggs

    Method Summary
    static void main(java.lang.String[] argv)
              Runs the testsuite.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    main

    public static void main(java.lang.String[] argv)
                     throws REException
    Runs the testsuite. No command line arguments are necessary.
    Throws:
    REException - An error occurred compiling a regular expression.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/package-frame.html0100644000175000000620000000171207364636622024500 0ustar killerstaff : Package gnu.regexp.util gnu.regexp.util
    Classes 
    Egrep
    Grep
    REApplet
    RETest
    Tests
    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/package-summary.html0100644000175000000620000001221207364636622025100 0ustar killerstaff : Package gnu.regexp.util

    Package gnu.regexp.util

    Class Summary
    Egrep This is a front end to the gnu.regexp.util.Grep class which sets the syntax used to RE_SYNTAX_EGREP, which aims to emulate the standard UNIX egrep command.
    Grep Grep is a pure-Java clone of the GNU grep utility.
    REApplet This is a simple applet to demonstrate the capabilities of gnu.regexp.
    RETest RETest provides a simple way to test regular expressions.
    Tests This is a very basic testsuite application for gnu.regexp.
     



    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/util/package-tree.html0100644000175000000620000001200107364636622024336 0ustar killerstaff : gnu.regexp.util Class Hierarchy

    Hierarchy For Package gnu.regexp.util

    Package Hierarchies:
    All Packages

    Class Hierarchy

    • class java.lang.Object
      • class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable)
        • class java.awt.Container
          • class java.awt.Panel (implements javax.accessibility.Accessible)
            • class java.applet.Applet
      • class gnu.regexp.util.Egrep
      • class gnu.regexp.util.Grep
      • class gnu.regexp.util.RETest
      • class gnu.regexp.util.Tests


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/CharIndexed.html0100644000175000000620000002341507364636622023222 0ustar killerstaff : Interface CharIndexed

    gnu.regexp
    Interface CharIndexed


    public interface CharIndexed

    Defines the interface used internally so that different types of source text can be accessed in the same way. Built-in concrete classes provide support for String, StringBuffer, InputStream and char[] types. A class that is CharIndexed supports the notion of a cursor within a block of text. The cursor must be able to be advanced via the move() method. The charAt() method returns the character at the cursor position plus a given offset.

    Author:
    Wes Biggs

    Field Summary
    static char OUT_OF_BOUNDS
              Defines a constant (0xFFFF was somewhat arbitrarily chosen) that can be returned by the charAt() function indicating that the specified index is out of range.
     
    Method Summary
     char charAt(int index)
              Returns the character at the given offset past the current cursor position in the input.
     boolean isValid()
              Returns true if the most recent move() operation placed the cursor position at a valid position in the input.
     boolean move(int index)
              Shifts the input buffer by a given number of positions.
     

    Field Detail

    OUT_OF_BOUNDS

    public static final char OUT_OF_BOUNDS
    Defines a constant (0xFFFF was somewhat arbitrarily chosen) that can be returned by the charAt() function indicating that the specified index is out of range.
    Method Detail

    charAt

    public char charAt(int index)
    Returns the character at the given offset past the current cursor position in the input. The index of the current position is zero. It is possible for this method to be called with a negative index. This happens when using the '^' operator in multiline matching mode or the '\b' or '\<' word boundary operators. In any case, the lower bound is currently fixed at -2 (for '^' with a two-character newline).
    Parameters:
    index - the offset position in the character field to examine
    Returns:
    the character at the specified index, or the OUT_OF_BOUNDS character defined by this interface.

    move

    public boolean move(int index)
    Shifts the input buffer by a given number of positions. Returns true if the new cursor position is valid.

    isValid

    public boolean isValid()
    Returns true if the most recent move() operation placed the cursor position at a valid position in the input.


    libgnu-regexp-java-1.1.4/docs/api/gnu/regexp/REFilterReader.html0100644000175000000620000002675007364636622023650 0ustar killerstaff : Class REFilterReader

    gnu.regexp
    Class REFilterReader

    java.lang.Object
      |
      +--java.io.Reader
            |
            +--java.io.FilterReader
                  |
                  +--gnu.regexp.REFilterReader
    

    public class REFilterReader
    extends java.io.FilterReader

    Replaces instances of a given RE with replacement text.

    Since:
    gnu.regexp 1.1.0
    Author:
    Lee Sau Dan

    Constructor Summary
    REFilterReader(java.io.Reader stream, RE expr, java.lang.String replace)
              Creates an REFilterReader.
     
    Method Summary
     boolean markSupported()
              Returns false.
     int read()
              Reads the next character from the stream per the general contract of Reader.read().
     int read(char[] b)
              Reads from the stream into the provided array.
     int read(char[] b, int off, int len)
              Reads from the stream into the provided array.
     
    Methods inherited from class java.io.FilterReader
    close, mark, ready, reset, skip
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    REFilterReader

    public REFilterReader(java.io.Reader stream,
                          RE expr,
                          java.lang.String replace)
    Creates an REFilterReader. When reading from this stream, occurrences of patterns matching the supplied regular expression will be replaced with the supplied replacement text (the metacharacters $0 through $9 may be used to refer to the full match or subexpression matches.
    Parameters:
    stream - The Reader to be filtered.
    expr - The regular expression to search for.
    replace - The text pattern to replace matches with.
    Method Detail

    read

    public int read()
    Reads the next character from the stream per the general contract of Reader.read(). Returns -1 on error or end of stream.
    Overrides:
    read in class java.io.FilterReader

    markSupported

    public boolean markSupported()
    Returns false. REFilterReader does not support mark() and reset() methods.
    Overrides:
    markSupported in class java.io.FilterReader

    read

    public int read(char[] b,
                    int off,
                    int len)
    Reads from the stream into the provided array.
    Overrides:
    read in class java.io.FilterReader

    read

    public int read(char[] b)
    Reads from the stream into the provided array.
    Overrides:
    read in class java.io.Reader


    libgnu-regexp-java-1.1.4/lib/0042755000175000000620000000000007617541044015132 5ustar killerstafflibgnu-regexp-java-1.1.4/lib/gnu-regexp-1.1.4.jar0100644000175000000620000007272307364637031020357 0ustar killerstaffPKœsU+ META-INF/þÊPKPKœsU+META-INF/MANIFEST.MFóMÌËLK-.Ñ K-*ÎÌϳR0Ô3àår.JM,IMÑuª ë(hx:ù*8çä%–jòrñrPKKù á=>PKksU+gnu/regexp/CharIndexed.classMŽ=‚@…ߊ‚(6&–vZ(gÐ5&6R 6f… bp1ƳYx%ØØÌËË|3ùÞŸç &è¨0ô•Ù‰ äãjó“HVÊ—é¨2Xgqv$T`;dzôRÓÙnÎò0w¶ë…ËÀ¸ä9-x¬n©PéND™dÐ=z6£‹êh5æ—ø.mÏ`„7âBŸA½éÆYâÉecýyL }šÔ SÖ©U`@#Íš(t[h—i¢S²Ý’±¾PKîíhÃñPKksU+%gnu/regexp/CharIndexedCharArray.classmËNÂP†ÿC ¬‚ˆ¤.L ^ºq©&†Ä„ÄèC"l,åJ 5åôU\醉‰ À‡çÔº£'éÌœ3ßÌ?óýó5ƒ„#ì)1äZÎÐðx‹ŒRÛôÊN“yS¸žg>*sd]Ói7· " ›‹QK )Ÿ°]£Â=ÛìÚOf£ËXŸ!T/1DLÇj»Ý”)°D·ƒ\(éQ.¹MJŽ_Ù¿öÜ»¸Še¨Q0¬©ˆ"&¼u ˜Ï»_¥.M©P¬Q…ž;âõ(ŠœÚŽ=8'§P/•‹U;ØõS«1Z…Æ«¸CÏâ—¶™^´‡c1òÔSBaÐòè €, #+Óë Vé§èîIòú’™û3ljöŠ„ö UøÚÉáäÆÄGëÄV@f‰dd“‚ô©(Ò²üŸ»t»ïëÒúߦ6]ˆ€FÎH&×?‘Õ¦HéQïAíœ?QþPKH]–Pw(PKksU+'gnu/regexp/CharIndexedInputStream.class}R]oU=k¯ãØlg[ZÈÚ´MSHÖP›R>óÑ6Ƨ‰#5_¤ ÁÚ¾I¶qÖÖÚ®/ þ@…„ ‚¦É/~©T§*>^ùü$Þëž»»ŒTñpwæÞ9sfÎüõè—߯+XŠ"¤àÌ–ÓʸbKìÕ3¹mË-8±'*§Þj.7]aíF¡*HܰnZ™ªåle–J7D¹Å€‚OOføìêÜ\þÚÇ…bîZ~1_\Q € Gr5§Ñ´œæšUm ÑÕâÕâÒz1üy¯×S*¹ R ^=»–™mmn ÷?„&DlY‰¹¥ÖfÃþŒ(aá°î@Ù*oKJNA¼Z«íÌŠm[þ }ÈÕ{MÆŽO\ç%W«0qhÁvD±µ[îŠUª ÃŒ‘爆!ßKj8‚£Ò{AÃŒ²¾+ÂGZ‹c §£8§ÀøÒ^Â8‹Ò¯xy™÷¢†„_ÃÔ(ÉyìZîÍxÁG~™Sëõ4è8&Ã^ÕpQª»¶Ch«¼³âZeÇx-Š7{B¢°”ß+‹zÓ®9r0”çJÓÎi8Žg%Ü;¦1ÃׯŽ]—?ç'æeÕ)I¤vSøñ×5œÀÉ8ãg9r»Aál9ì)Û±›Ì~~üP®~™Ø†"Ꮉ!ÝJßR¡;ˆÓž:ÀYßLLIË“>@Æí#aª2VÏvqÙÆ-Zù”j#±À ×ŸüR;,zËX£~ ÿÞhü~7¾Å ±/tdqã.ôlG‘&Ã;FâQpQ½Ë~„¤s3m•ìÓzì“.ÒòÑø©÷Oý€¶tÙâW¸ôAêb£²WãFú‚û#ôìtÐþŒi¨DO¥¢a–Tý@È} ·¹#ù#‚¾o†ÈÔÔcrºv(“yÙëÙÕ •Ÿ.&Óbì6‡—þc]œjcØücäÌóA\Oþ€˜™<ÀÂú½€Þ¢·WÅÇPK†:4fPKksU+"gnu/regexp/CharIndexedReader.classmS]oÓf~;M M +§#3H¶±OÚ2š¥,¥M§~ЕMbNò¶5 vå8¨ÚÍ4iü$.˜”iRnr3‰i `»Üá‰{Â9¶Û1 ¿çœ÷=Ï9Ïñ?¯þ|§0CDBjÍnæ\±&¶6s…uÓ-Ù5±%jó¬ 7EBòªyÝÌÕM{-7W¹*ª^ }†ÞGî“KSSÅù+¥ra¾8[,/JJ2 @ÂÞ‚c7<Óö.™õ¦[*_,Ï-—åŸz½ž„HÅ•phƯg9¹Éæêªpw°œ•µ¸…Uš« ëGJ ›JöUÍê:×– uÇÙ˜ë¿D¾£Å[ùŽf.“Qpj80c٢ܼVî¢Y© ðNœ V¡a?k)ƒègí]‚ßë©Ì£*öbkÇT¼‡“Ì ”¸”@'b0hDooDÅû8E@\²ü‡dU$ƒô9â#r¸fº$FKAÒT|ÂÅ6]Ëö<³º±èšU‘Àgø8†Ï%ìß)Xš+nUŦg96O‡è9ï™ *Æ1AzcÃÚä«éÌ4'ãzÎux]V1„ƒ 3IÓ¶D—Ås³lˣ裻$…äFEœLÐj]`mг–T|‰óœç"³à4ݪ˜²êTeè»vš3"M¾2}Qôã0btR €âdïyÃfžˆ_'b|™ å`(‰I_·$£¤Q[”áY·|øÙx]áC>³ä :†Y;¢lc¡¥;–ÛÆ _Ô:8B/#‘{H<ÞÅh N±¤/ßÅ=²¤¡°ïN´~“$_´œÉvñéΓÒ&@y8p‰GþΆŸ£~àoýWô3ª¶Î°î£OKûjþ>&ZØÇØòZü‡ò|©ÿÞ{ñ¸«ºR»ÑŹo[Pf[¸Àè÷׿Îÿõ8Á$‚Ù´õä«ÐP|ã7†–'0aè Aöctê>Õ¾9N™Ê©6‘šÂ7X ¯P§M’wñOÞiKžù T(²ßxˆÂxê6ú/RïNï%%‚ðÕ.:±(‘àiémÄd*©ŽàM ×i…8ó÷”ôk#BH -Î#ÓÔ]¦Œèã芬¥—V::г!s›&œ}†LÇ[4!³’Õâ1M p9uq#ÕÅÌò!¼YíʯPKÑá´ ‰lPKksU+"gnu/regexp/CharIndexedString.classmPÉJÃ@þÆÄFkܪÖ-îUÛ¸ä\@ B@ôP)Ø“i;¤#m"1ñU<éÅ‹Á*xð|(õŸiEDs˜ofòÛ¼¼¾AÃÖ t1X~Ðt"îó«s'_ó"7¨ò+^-Ä‘|:ÃЙwé9u/ð£ò¯Ä éÿyzFC„NG«‹k¯\ç ì‚!uð£ÖöØbHxA¥F4á2huÐU…4÷b=ëæòù°Jƒ"à‡ÍF™GÇRÔDÌ^®‰þönÔD/’r—61€Á$¦0a`úW‘¶µ|~2â¢H)«ä͕ȫ^ò¶3Û"ñ.ÉeÿfwsE È(j1IïºdbY¢Q ?®©®Ì°Â,„ͨÂ÷…|ôŸ×Þ”ò˜§äºÐ C!•©¨Â~…:MQ9Z‡è´A÷T öF¦Ow,±;¤¬ ÐvÜzÆä=ºSÖäÇ0ƒÙu†¨ŒpXR%í†v]ÿS‰ähFå&ìeSjýÇ Xì0V:¹¦ì,Ûk-ŒÛ2Î3r-ŒÙñ;.¶ê¶öPKK£(i§PKksU+(gnu/regexp/CharIndexedStringBuffer.classuQ]/Ã`=¯ÖjSÆ cÅ|oêÞGÂIáb²Ä®të«{eZé:Å7nÜH|$.ü?Ê<­ Ö&=}Úçœçœçýø|{‡„Uô0ÌÙN[÷¸Í¯.ôRÃô ÇâWÜ*ûžpìÝöé)÷È Cg楩7MÇÖkg¼î+ˆ1ŒýÏVÐÇÂÕËÜfS\›µ&g`-†Ìþ¯ÚßI 1Ó©7\ú *ꤹã3Èy£P"(¹I$÷…ÃÚç5î¢*ú¡ÆÁ0¬"ŽDð6¢b ã¤ÐäŽí7¤|ÁH`£ &É÷ÿóU `0èÊJ@§Ã ˆV…¬[!¿JÎÝKþm‡ªØ¦p„¿Í å»2 sX * ZüC¢ì¶½:ßÁ>´.[_ ‘£,zÐ :-º)@H eúKŽé™¤j¾“o,ŸÊžli„édîÒn0TÚ ´{ô¦¦\ Ó˜‰Ø9b3ÂtÀŽ˜·P¤{ÈòOw³Q÷rè ÈÃaÕç.$Púùˆ” &‹¯X*®<Ó,x‘úr˜,ÿPKzíNb ¡PKksU+gnu/regexp/CharUnit.classN»NÃ@œuü'(çRÜ 4VREDJÝÙœì3Îb„ø«TH)òù(Äž‹fg÷òw:£‡$ó «1³s‚û_ŒŽ@3z˜üPK®e¹ÎõPKksU+gnu/regexp/IntPair.class-NËJA¬Þd3q æA> Gt~@¼ˆB@L0’ûì¦]:¬³2Ùñ¯< ò~”Ø’H¥c‰ô¶ØÐ˜ŽàÖS©Ø^=…°Ø Kµöè©‘±d¿¾~,ÒÛˆGOǵ»¢íëz;0j`«¸¡{Ë®®ŽíÑ®“šoÚÚ¹%jI 7»º·¬ïîdˆ·é0 H~ëºÚ¯ëî‰vm踑Á×]â®h×–ŽžÍÝ붦w‹Ád*-Q×9×=¬ùP,¢$Ɔ{Çö±žáÁÄàðØp§žØ›ÞG3ôdjp„Ù4-ŸëG{ûHœüUÝ9˜Ð»Æ†÷èÉ-±=C©Ý«§;GúcCƒoÕã› o"\Ü4—‰_ܰ _…åpiKÜŒ97¡If„EåâB +ÒƒB6B¨Xf÷ž›õþt[´Ô)½‡騡¶htù6"î8Ô¯¦Éê”+– æ'¸Á;[uVAaAz¤}_,¹.™Œ&'5-ßÙî†Ë`¥W"TìlW€|·p6ñú±=©ÂUp5‚sHÆÀÖ´<ꆬQa¬§Ü$_0s —«)ÝÙNZóü5*tÀR¦GLW] ¸®DMÃ*,;8ªB#4ð×U¨7¾6)°™X0›Åm%—ªÐ½¤ÚöïÕB5Ý 7(°­tFéͱÁ¤¶Â *ôÁò‰Ô›!Ô7‘â2ÚØZ„Ux¼™œÕO.ÀöJ’r“ 1ØCR‰;5º|‡â°[½T]3 *좮سŸXì`*ì‡!òQ,—É^“Õa»nVa<„žÛMÄõCìž„ çÎ{ ûƒTi±da‹F£gJ­ƒf\D o£¨Œ¿°¿Þ ·P’ŽCú°ž šE3§pX…ÛámÆÙ4˜Ø;„Ð:Û¹2m–io8ü6Þζ:Dñ¨¤ÀÝ©Â;âLéý#‰8ƒŽ¸à]Uƒ‰´ž<jIÆ9a—ÁEÌâöÇ{„Kç,iÃðKá^ÜOõ"©ê±tKb¤%ÍŽQà}Tiç:¬G éq|€ÄJ¢þ}1ª6q>ˆ°d.ÍvRjýU‚Xò° &/KºX*¥'yéª0Î+Ìkx¬PïÜÔg>d{ÛÌÌŒ >Bù,éôáÑôaCOŽB†R9¥§MÕD)j+8;êQ>:»°ˆY^ìÄ¿#¯7EÛw°Ï‡'\ðq„š±Äp,Ý¿O·ìIÆú÷ëi|Aí§JžbOê òÉ1r¿…):3þ4Õtblp~>å‚$*ž:¸¡w» Ÿ…“4?È™Þ=`,±(×­§\0Ië.‘L+ð´¥€ÍݽÑYÀ´Ý!LÁç¸2QF?gŒ °y$5x¨—ð‘¤Ö5Pæäi¦Þ Â—àË´óíY³j#Q–÷E¾Â%ÊMÀá-#½Ôx‘œUà«–zw'ôîÖû뜶ÑÎÙ ²MØñ"|Íߢ´-„`4–Ô.ø¥%☔!Pá%ø{*{qÛµèrìÙï²ì¶õû*¼ÌYé&'uý˜Á?TàÇT-çjÞ92²Ý>=g?e1VÙ&Ô~¢À/,íïMÇ’TÖ_åÆÁëûx¯NÆÅD5ŠÃ/™ýo(Y›æÆJT ŸÃ¯øŠÉ\扸^ãù´œ_—8ÌÜÿY$»‘1¿‡Ráð'wª7MB‹6C•þøþ]w8¶_7&üo*üü7'njÃàÞAÑÚ™âÏðŸ ü…zCAq^`±~ª^ Ì øçê´žVV> ""måqƒ¡£©],…?Ózƒt£Bã¿¢Ý ¢]ÁJ ‚¥(–LµÀXQÛÜèB· «H1Ê—TËÁÁô¾–=$7E+yŸ°cgY™ª¿CÅjôͪ²æ¾FôDĘÅ4/Äó(“Ù…ì ÑÖd³ÀŸÝ¡%:W1ÔT\Œõ´¬¥¾ÑáQj­MåhLåü*.ÁóÉ…ý¼E’­¼}.ÅF/,­‹Eô´¹™Qð¢Ù~!›ý{‰ááex±Š Rè† _¶–Õ«s.»6ÖÔ†ËUl=Q”ÄJâRq^F*'ôCé9›kƒ–ñ.åMƒžÞšèÒU\ CÌnqͫ쮃Âs®fÜ+ÙS«ø¼£§× Î|Yn•;­ÔPq ®EZ§‰% ˤ°L…2BÚqõ¦-DX1_"”¿^Åk¹ r¯ ¥#H8œU¼ßHµ€– o¡£ì娊]¼#´Ð96©xZBÔ*ã Û¬âÜJ —Û}!O¯›G½²]©œÖ½*ÞÈZÛSFÃÁí*îÄ›( úGFÓîk„äÎ2{8ÜÁYä°¿YÅ›éHqafw;~Yš¬Âo˜~(ÊÙ“‚ºu‚Y°ˆ›Ö[Šø_»pÿ¡—@ò•s€öe\ ëËFÉXåÃ*&¹°:hÅ’ y‹ŠcHGzgltTäJ=5ƒrÚÐþÓÆaUhÒA'azŸ8ò^~޾.""ŸBÚ»¯:g·³Þаò\#PL« çÅáy'Bó¬ÒÓ6Ï2%ߎ|£@{œTz0=–¦ Ym¡ß¹ëñ.¼!rNôe¶Lˆï@¸òÜ8Xªðn¼×سI{ŒjpMùîpîšÝ£â{ù¶¢˜;-}ÎÊû8+ß'œž*ÊΨØQUñx7K{PŇٖš’i6‡gª¤ÃŒù#t²jŠZQ¸ü<€.|´dsËç Ý…™â£žžLŽ$U|\lÅiƒ˜bÛÜø>¦ Wj 6œä$]˜%¦yz¹;ÆO Zìñ±áQ±ºË• >%ãÇ]ø)*ök#*~†É&##¹R~ZÁ§¬£f^ÆôàÉY;¡|nPjŸÀÏ*H›ó­™äop˜ÏÓ¼¹0îZ0‡S ~áÂù„›—9=xšÔ,k¨`8_PðYs£:8B.ã /=6¬à–ZK*BcA¿TÊÃò~IÁ¯PLMŒ:=ÐN_,ëGƒy¯;K) ¶/àWUü&~K\TîêíëÚ²îÆ]›;z:i÷¢Y^8TB¿Qn‡º­Ì–Åúêb§‚[…8D!¼\kú‡Äõ” XºÃ—·)ã–PÅá+Æqkƒ>J]rŠ ¸¾ÔÛÜø|YÁŸ–\×s*þa\½˜W×X$Û\žÅbf]*»ñUü™‚¿B¸ €³992ª'Ó‡ç\töŠáÆA(=-LKéÜÈWÁX pÒ¨’o¦A7_¬Ò·ŸŽ1ž<¼ŠÆÕEc/kŠÆ>×ëh¬Òø¼¢ñ"û‹Æ‹é©‡ñÝ(ßKhžßç‹w+á_ ô¾FÕôæÿl>司XÄ7Lr²ŽˆxÚõ\ÈAÀÀ°sÐL«øF¸”q=¿)žW‚ÏÂeãP<—åàŠˆ3 k ´zT­æq+#ãp>#9XûyGÄÉŸ6¿ó´ßiËA{–ps°Q0¬l§àzŒ¸Üq :OAWƒãö€b˂ݮ´…ÝÓÐÝ7 [" ¦a+}l§2ñdÕ_ûšÛ¿` v†éuvyoÍ€/ä­ÊA?ß>KB^7 Ça¿áÎ@LÌM@_È[IS°9à÷LÂð4`_à$tÑÓIÏõôŒÒ“œ„±H5+™ô»Î‚: H‡C—ßå¯ÎÁ­¤v_Ä#5Ϫ7rnÉÀC^—ýZÈ» ¯Ò8¼z«¡I¸#\­Ukî'à~õ$ÜÅÿÜýÔNÃ¥}¾wNÁ»íZõ$Ü÷ŒßsVß[ |—ð÷—œ€âmÎ?T<Ÿƒ‰ hÂ|d$Ƈ Z5ùÓSÐHsOÁcäph4õ8;jTXªUNÂÇhrÁ†á;36Íp°ÍcºªÚöÚÂ5š[SLqY§hn¡yce_¸Êûæ \b{¸±ó³0ÃUZ•÷MXªU…kÊãf+6^(ZÍ8ÄæãȲ‰áµi™V#Ì¢èzCáš,œÏSOšSU<ùš´ ²øe’tSÛC6Ž7¶•VöÙµ¶p︛ƒSGáæw‘H“˜>É«p=Nz6С§—žvz¶Ó³‰ž8=WÑ“¢g#=éÙl×*a_Ò‡·’¿T;‹£ZJ[}¹"¡×ŠïO²¬µô$èIÓcóY-ß+¼îp]jˆ-½Ü^¿lìØó¬œ¦ùHDÏL3>­R«„ÏÓé§Õƒ[«cǺ 7Âí䯨rô°‡7 o$ë¦!Bùô…ˆAöÝ~ß]ô=òj"&Õö0ýï³sÄ*²5᪀À•!oVP@. yÏ'-ïlI)^fç?uüM{]&œbJ™g kYèÓêúh˜Gü¶X'Â$Ý ‹JÜ •G4äÕ+¦—g@+vÑfÈõ¢‡ô…륢¢MÌŒ›ø3÷—àÏÜ¡yÌugá°q­z<>jöÝÔÆxèâ$áîåÖÜGv‡rkáPRBºãSð=j~ !m¡œŸ„D ~ÏÀüH°".Þix¥ÏïÑ|“ð³ˆGvü!äõжÊ›õ†R³Ši¦±À¤úºJö¾¡=µÑÀ4ü\¤kƒ×uû£àåàWÔxq~KYÇí²2´¯YÓþNÐv´-h“´—›ä÷‚.äu S< J¾ã‡¼ Á&á´p6ƒC o“În†î2ÍÐý:ÍÐ]Ô ‹[ „Û|˜}Ï~›¡E0™{†ûBv‘цΦçÿ¿”³”³ýÌPŽªÅQS¹‡,•»c>åV…¼>Aãç| ÿ:Uòó?²suÏBËë«o³çµŒ-ÆáJ¡íüÏ8´„¼¡îEfRüµ°­ðº§ÐFÅD]ñgI-S~Hù…BßÅ&±‘Åœ·Lñ¢¤h1(öd`™IQoR<((œ¶IT˜äaIr‘A²&3Ónb—b^=Óab¶—ª±~5ì’Ä+I.5Hâ¸8ä­$ùý—ÑÞ£»þ¨”hüDvIô1It±A”È@CéÏë¶›;¼¥59Õc¢n–¨+ ÔmêLU–”ªâ­,°¸”ªw~*i¼ZªVz®Z•R-xºÔCË{È–× Ž”mŸ—ÈTª»4YwX%ëkf²þîuöÕ¢5þÉ/·®ç¡Óïšç B;?:^Ç•Â*ß“¸È´opq_`]8‰*ANˆóŸ›ÿÆdöùzèøËáÍú#ˆ+OÁ®æf6²È 2ù’úÀéÇÁ[ÀÊͨ=ÜÜõ\ê IˆÕèÍŸEí$“΢ Í–ÃÚF]†ÍÀh(ÅðIŒE„a§·JS¸¨¡q ¬ þyMb %zï`ž……AÛÓxAÔâLKŽMã2vËõÌ¡)bgÄ ßžÃfZð+ú>‰­&Uöc ¹=ऒو9ÜÖqœÉqˆú¾€Ë"NbëÌá›üÎãÒs JMV=lÑEFøÝ`swk>‰{x%лµ[œÀͦËú1ní²½Çóû¬]V„1 14r»¬Rª¿¿€r³DY,“´Êô*Û¶Í´f n•xŸ”~}´4eE¼ÇA òÛ/$xG Ⱦ§ý˜ƒ/kêØ·­~'ýó( cÀå¡¿ap§MLvû”c£äQ¿ƒ¢ÓÔßþ<­…¢ÕãõÛå0‡·ËNÌ@Ó¾CxØÚ·0n³vcÆ-£ÈìFï4ÞÞWȾ·›˜wá‘"‡Û ‡7³¸wPÞ57&Í¥(wÏI#ÉjnÔ¨a¿ÇÌõwã½ï-2&ºyXuƉŽÛøÂë,TrÒ?GžÔì¾Å´mVš³sRÆÝŸÃ÷o~7òZ†ßaåÖßL¤š(kì (åŒ-B™×Ø™Æ>œ7öAÂrÑû]yc³0XÎ0^”×]-­›€K¤YaESD- B¥ÈHcñ;­mÁ«}çÙ™ûŠüQÁ›(5l—©vEð,ØOð!+¤]õnn¢x 5¯.j”ÌÕ¨½‘qÎ<™Mñ(dæ4Å™΂¯°­nä7 ЂÄñ@}Ã$~ø¸äò Ø µÖP˜öÒú«³°,Ð(î7jtÖç«(¥Ñ±ûX3ÙGlØ8m?6ó²lü—гõÁÇ( èýA¿]Ü7šûÿ°£!ìlž¦]ªæûôZüéêl§lç1[ØeÞ±Vš¡tü•t.¾Ê_iîØ«ün1`­ˆáQȹ‰™—üî¬(‘q´XÏ?7… +‚È{[†rÛД|B¡½NØ•…æ(û±F‚¼9÷º ¸3¯r¶DEi@ßU³Týi^Ú^Gy2Îí{„ôäm¡AYš¦œ‚»BšëÜÝ`vçŽüåüÙÄ}RûNnãOóY ü ŸÄ½RↂÞ&¶Œ{¼‚µxŒWgòó°@4®z—3’Ì]þ;%Éæ¹n ˆk|*'úgà²úIAoRÕ”TíhO1rò^Yq.Sš’Ö«*ßH“ =Ho"}C©Våô’íÏš†ª•D|mysïP)š2ôµÕ„fÒI"fñ˜Áµ¨jª¹DÎü‰@Þ‹<ð”ŽürõXíà 1kÞZ åÎᙋ ¢bº1]1”µ.b /©-ÈmR/Êeõ£²aû¾ÿo×âE/Ĩcþè<+ÈónÉ&Ã|‡r»ÉËÐù kˆ xÅ0bÅL¥nFš6W­ê"^cÞ%W*жÏú/ë]Zà{“àR cþø?ó6D„öÒuK‹È"Liê,ÎůNÐiñÃØfêä,Ï æ©k²zÍ(*«j™¶ßg»¼Ó|µ&õm/FÑ‘›ßDÄ{‰»m,÷Øø*q¯}Ä}6î'°ñ ñ‡‰Gl|xÔÆ×‰Ælt¥¬ß“Öè¤ØÜ¥ï{D}42þïü ÿ'ð‡!Ð1<Õ Ó)5ÃIªè¤qÙùÓÇ9f <ñO²ÉsÌNñ|£á Ë©Pxê «'Hn‡|Þln‡‚§xcñ rŸÑxf±Õ¬ âó®âšÄ&C01%ÇéfZ×E|!¾",É¿)Ö-±&t`{;ÄÏfDÌ1ļCm] m3™|9îª ñ…é1 AW³vJihŸùÆ~ddzv>Ox®“Ï0X+§ÓÊ­ÅBIƒfñPH§KÊ£Qò\eç4ôïžÜ°]+¿®6Õº•/–½D-IÐÆ¼ãMhÔ‹9…øÞŒÝnhp‰W™,¬+¹Š“WsåÜšríµ,=1Ö5è‘A¶Ø’³Ý‡‰r±Xp=U÷®ð¶‘Õk–%q?-Ñ¡D¡ì¦ÔuG:¦ixÊÝÓÔ°4Á¼)UtUÊ&˜‰³¸­¡ïo,‰wL|ˆ3&zqÊÄûøÀDŸˆÓèbÁDçL,⮉% sû0k{© –MÜ“´ô bÒÄ VM|‰û&¾ß×x`ÂÆš‰ØBÚDL¾ˆ!®áÔ>ÌC÷Óе³Š#bG/JöÐutȒرƒ›ãî³*Ÿñ6h¤8¬«$±'¹§´dgî¨e_§œyFyÜp¢¼FÞ"–UÃöçd,â‘·pîjS“íë*Ï*¾UY¿#¹DM“‘%¢u¿Mj6y…{ õPŒ\ᑪ߉•ZKìÙs¼²§¬¼WÐp&r™»HŽnþ^¾eR†–OXSÓ} MîÔô@C“_Ô~h$G„r§iž êÞhì%´è+ø’1ý%ô Œè¹ üÑ¡ ¿2AC”²ƒéÀ%ÊQ´ã2N`ŒmŒ3JÕ!µaFùë‚¿¢/|ƒª&1«hþbE“t­*hª"´E—QÅ;Oá÷m½‚™äÙ_E U+[i›‘³äĪ8ö÷b/ð®NÑ>«ù^#xœª/ |kãÌ­QÉ TÑQai£²ÛÍO0ÅÒwz qâJO{ç3iDÆ.šôÚÚ³µ;‡›¼=0…0… ¸…˜Á2fùÀæà`›¸ïp?`Op¿ðén!‰ ŸåïXžÌ?qŸˆCn¬ã$µ&ËÒÿ«¨yTmÆñFžÃ ¨/ê#þç8­¢kľgh ûŸ"è{Ø¿ëyìÓÂÆ÷‹ýZoÒXŸøqûoºw¡O£‰ò!Á²„ËñÏ!O.È"ãYœ‡[+ûQ£l¹â£nŽÆôØë*Nìò[†?®‘í<>¡Æ¿PKÏN7ØñàPK³xŒ*gnu/regexp/REFilterReader.class}S]sU~NvÓ%áÐV (’¢ÕR6 ­µ~Œ€+j…¶~°INÒÕ|ÍfÃðú ¼“Ænzã 32Ã¥^zå•?Åòœì¶C[ë^ìûž÷¼Ïû¼ïùóßߟÃÀYÔ,ÄŽ×[½¼¯êêA'¿xåª×”¿¨Üªò-˜G¿wï»y¯ùFÀ¤;ÅXqGô¼€å«Ní(ÃÅahÃmÕó¥À÷Zu^”{µšN •N»+ ÚµZWTº¯Ü¦ÀÉ—Ö\ßiUÕU ë3‘I¿ª€agoÚU¥Ñx-u³×,+ÿ–[n(‰$ pD"‰ƒZKI¼†qj¨V=XKâu¼já„Àøn°8IÇ ‹_&4Óv2ퟖ8„QìM‰·1Åž½î’ÛðB8+ILã- §Òÿ׃… 9ÚAß 7¨¬IÄ1¢³g%gD¨Éº ØT©Wî&‘Ç ïÚ(!ÃöÞ•˜ÅûD}ÞkyÁE*¶ã8™¥$l¼'ñ!>ˆ7u¼½ÇóŽ¨æu_y| qاj±Ûت“`ây‰K8ÈÄžŽ×–O$ øŒÕk„Ñe­ûÖ ±}*q Ÿ Ú!û\<;³w´ïU‰ë(r Íö}ÎeÈùV8î›_aQ`´KÎ/èÊimi{oÊ}ª|©S¦ `s“l7]ÿ‡R¯Óiûbã–½Z ­ŽÄÆ“¬x—ÝÓZîh˪ÀlT'ZÛ]¯å?À,é~ÇÝ«‰2ð­¾/kvvß§< — Sj÷üŠâƒ%=Gv¾és: “ÈÖ0‚˜Þ6j1ÍÝP&"É3”2’ÜyÊ8#Ù3ÿ¯ðôÏ:Ï_Ù'8ú¦(Žiu€ã¿†Zv™¦ó^Çxcƒ¦ÉN=D<¶ñ ö2ϹÎQÌO1WÔgíCãÇ?ánî .ü]^È…‘W¢K‡¸qG§Ÿ‰Î¬1“Õ~ ”ú,mö·Ñü©5c •[Ò‡o?Ò@´ÁÜΦ±Î¤7 ?%LE½ŽR Í„±uÇIGw—È‚fqÖ˜‹?ÆéìËsfÊŒ=ÂX*þVì1â©øF.½)óÇÛëq1±nlþ¼ù7­ÛÙV¢l)˜äHdsFîù_o¹Ìâ›È%CâMʉlî)îeŸaz9G+}LfÏôÉáÙ>~‹ÂªÃù©PK÷‡évøPKksU+gnu/regexp/REMatch.classTmSU~nvÖ°¼–5 šJ1Ù@Ò7©ÚR-Úh Zj±Å–ä&,†Ý¸ÙtÐñ“Sgü ýdé¾tœ1iµNõ›3þýâ¹»‹„—jÇd&çÞ{ÎyÎsÞòû_?=„qÜV`è+›õ´ÍË|£š¾63§;…U2CÏš~[OWt³œÎ¯¬ñ‚£ ¡ß}5¬ô· ½b|¡¯T¸‚c Ç÷ì3ËäBÁб.yñ:ßp(VnÏhÁ± ³|¡—*z¹ÆÀ²t±J¥'Ó6Ý,¬Z6CÐ0‹|ƒdÍÑmR–ÈLâf‘A6]ÔþÜá7X4HOäæBj9cIÛ3L>___áöuAYÅCTŸçUG;Â*zÐ+NQ½*ú¼ËK ^&ÿ=èÛ¶l'1Jô/¦á\"¦ñÄN`DA‚aä@‘æ-g¡^­Z¶Ã‹3^u Ëd鵚Q6gmka(~T~‰*º¡ "c®Dáj«ÄuŸqfU·³¢|¼H N3 ìÀT½Tâv§0¢â^%°¹]¦ÂÊñl"Óó8«à5r=YÅmÔ«U·+áx&q¨Ï^” "Ìë*.áM†cŽåé¶ÈŸ a;©¢!‘äe·¡\·=Z”}§—ý Cg™; b:²Þ¨PÍiF:èuÆ,úoät8Æ1ä by†öZ}¥æ3Œg²á=Ì)¸¶o=v³è4ê+­LU¢šæU›tê2C—g¶G­Ëk8u‡gMÇbŽü2gU,áCŨMeÃmZ&q+„qKÁ'û×’z¦N3ªc…êYô<‚ñ ±.Ë¢5o‡¨ªnW)§±g¢ÒÒÝ’Š5\¥q¨p³ì¬ ŽݨœY±’˜².¯s¦ŠïTU‘Á´ˆKí -Xu»Àg ñÿ¡úóž!qš,$ýå¤Ù€øŒ+;}ÙåËn_Òúº²Ï—´Ø®ËN¿Ct»ê"ç´‡xáW°\’5Ij?`¸)^l`XÜb»·Xr;÷'n>Ä+¿¤oÜÅ×è䡎¦@iI"!c ï>ÞÀ¸ ô=¼O ißõÈô¾$)ÿ§(Ö™9éÒúÆ’Ñ1@ïH,*ˆI©Í?µ±&Þj`JXMÏh*ð-i ²,ŒZ®_ÝE¯kÈ»š@ÞG~²¹ó›ÆZXQw|VÐF…ÒZ¸YM¢¤É-ô ·ˆ€‰–òù;ñþhbbó} ^’¢jA²›ÚöÕW¨ žú9Š"Ô*©gÝ ¤–øVÙ§ZÅZ¬h’}« ª£h‚v9ÝG§áTàÚúÞÙ¼N5ñî.Ÿ\'Ï÷ÝÛÛÉÍþ„‡´‰`àç:!4%²…vA%ò‹+„Àþ§ïg‹{:Bö¿¢ÿ‹ï">ð}¿&Ï ÉÏ[Gp>mâfÏÈ=œOFåe:?ÂGw¡%Å Mè ò€ì×¼kL›àM¬.n¡sÌußßdŸÊÅÍïÜÓýVµ˜çm O¢âS:C”ÄrŒÒ¶®kayùçX.ÿÓh¥,-ÚÀgZ¤‰Úîô9ô@ýoPK†Ëˆ‹£%ñ;XÿôXlT‰¨Š½S‚VÏ»‰JâL»$hðæª†í±–H°¬,hñ ‘F·õƒšíØ1[ñF¶”'ÏŽ¬²sóÖ+\š-,5®§±‘øpÄT㥜¨¶ØŒ9‡©´/0â1Kó#.æ*–®ÀçºËø»lÏ4fµr±(ªZTÑ}—kn&_p!ôÃZTh\5õM| DZʴ6—im&­êÉT!_|7¦ ©ôÀ`ª`¹ìo0•Nei|vcéTƵÜC‰\¢ÍáØ&¸\¾¤§÷&3ªg÷âÃѬ£±1}pÒÍÙô„É`]/ :$Ý*öh½»eØ&±—áQx,“ðD¦ü×QHÍò´v£YÅÐAHâUZx µtÚM&ÒÊÔ”›Ï«¹\6'C=ÔQ°'e8XEíÖT&U؆cî)F{ÇC°ö˰²,ÛqJ/#AÍTÚM ·Ã%¶¦SÓK»Õ[ÉeÅÄeciAGÉ2GØê o| §wœÊ8ÂÍS2™gˆç¥õ,õªb@2|^ô ÉfÜÅ!Ø×h ùx^‚º­Si¯Kuð*^':ýy?;^‡7ðÀ¬ã¹ì!7W8.ÁºŠ•—±B𼄷K¾„Öñ|Á=XïâeÏ{Ùöï£'Ãû¨Ú“¢ï¢»7ŠsM$Ý|ïá#<°%ņ°Ø—qØI»Od…:tš&êïsêÕ)Ú})Ó~-ƒÆvßÈðÛ}+Ã0Û}/ƒÊv?Êf»Ÿeˆ°Ý/2 ²Ý¯2èl÷» ÛÙî¢ £l7#C”í®È`°Ýœ 1¶ûC†8ÛÍK²²Ó¹)¼uiö1f짆ÁFT à_ @7ÍÓetÄéQ…4Ð÷œ>Í #np3â·"np;âw"îðÄÝ^Šÿ— x9â^‰x•€W#^#à[ß*àÛß.àµˆ× øÄ=îEÜ'àõˆïðÄý@|—€7"¾[À÷ Þ$à͈ïð}ˆïðˆðÄ[üvg›€F9ž-oNƒœ†9âTåt˜ÓN#œjœnçt”SÓ(§§1Nã­¢w×£ø,{tÌ;7tìðÆàº‹~% _¢_U}ÕW`Oß`?ñ¡æ ¨PEf}—ÁY> ‰ó\oWéÁ3J*+PeÏihš‡}— 5op£CELJÿ‡U¾hU€inµ–[-­`µþ -šƒãܤ)•Xƒ&G}1¾ª\ÜÕžxUß<Ý .\‚“äj&'Z–ÎÁsWÀ¹X´;ÅíÖóLV—Ù­Çôg᥿a²hØ /û«z¼+ U+Ú^¹ oÎÀɶw®Â3šib>ž…Ogà3jfá‹–ZZ‚´ÔÑÒŒ *’ ÿªšá8ãsÈÀÓo E¦¥‰–_ó,w(zö”‹šÍ%êß‘ú%8‹®>ïî‚¢{Y¶ ù:? UsjõUó”ϱ ç0sÓàKÎ3É”xø·Eø‚_wK½orIlE]i+ËûqYèG1ÑEf }i÷ÍfY"³ºÖg^˜¤ÞFK'-]´tÓ²Ä׾ƴ¯•¸øÓ?ny÷úPKüRn‹•qPKksU+gnu/regexp/REToken.classuQÁnÓ@œ8IM)MÚšÒŽS0÷ $¨@Š”‚DJ½9ÎÖÙbo*×Fß”  ŽTâ£oí•PØòÎÈ;;óÞÛŸ¿¾}‡ÇسPbXeæ%<äó3ïÝ«ÃÙ.-˜ k§þGß‹|zoǧùãˆ3˜’ÏSÚþmÖg(g2Pªêy6È Ÿ3°%„<=RÄY<ä2L§ †Ó¥ s6!ùõ¡üMyrXÄTÏyú¾ðj9ÿÊêÙ¨¡ZõE¹±Ÿäê]ÑîOý$¯‚OúW=”¼ß=¶a›6𨍻InÁÔò¿ÉÇT÷$‹ÏÚÎðÏìFi"dø2;9á •Ç`)Ñ‹(²qw•õ–{Ûf¨<£¤ÏÉ˨fvð0ŸÊQ®ì:VTaC}4Ë’€¿j¶.㉠6;¤0è+Ójª^šF² TÜÆ5R­[%d„%câYà ½·Ž½@Åí] ñ¹‰šKN,ÂB÷”Ò Â]÷ Z—Ø$h\¢l.éí-qK±VÁtÊm´õé†N±TJË\èšQ.¤ iá¶n¸½%:ÊñVrã%îçÕѹìjy‡jRò¦û\FÞji¸í t 5ƒ«:Gï7PKT¦ryçPKksU+gnu/regexp/RETokenAny.classu’ÛnÓ@†ÿÍ¡&ÆMÒЖC’åd;i\®SU*Ki/hUD®êÆ[Ç`o"ˆð(ô¦/Ф¦.xŠ2ëq*¶¬õ|óÏ?kûþå+²XÃc†%O$VÄ=>Y/žî ßp±%Þ+È1TþM1(‚¿ |ÁX¡:q°“CÙãñ¶/ü0 »\xñ€!«6C®3t‰/u©l' y´çô&ŸV3Xz÷·VÙÂåcî¶»XØ–xÛèi(¡L徤Ȉ]@E×þöœhXÂ2Ã\Ÿt·b²£ÛFç*n`QÁM†åË[g‹ yÌÀPÕ L£º†;˜'ÁDZJy›b7 GéÝ×Î[Ç áY»qä ïIrtÄ£¶±¯á’ g4â•lÇø­BÇ}y»œ :èx“Ýîõ¤¼‰µéhûÒT“AÝ&QŸ?óåI—~}Ú–ÔÄ:B#"C7͘FJºæè¹9ªJQ‘V&³¹SL/ ó³ÜsRôF£y†…ϸžÁf½rëUó µcêeõEÚ¬| Í1òÙÓæ+Bs,˜æ9îþT]Ž™êbê‰<4Ê­s†Žó½™Z5í’Ïa\î(¸ƒ!m¾îÊäümRL,ò²[͵ØßXI†é8æF¡RÝ`ÐÕÜ ÷Ôâ /¸éì9¡¬6'cº„ÊI~fcÍåe*4OÄ *ÖÊU†Þfâ×±ìÒóÚÒwÒÚœ‚!ËÌj•ÛE†˜:ohÿƒËx„a ÉÊóD4F7ÄÍÐBÍyOê'1ç©cg*5§À_X«än¤éFx¤¤“ÐKÈ_ÑÑ,Ò‚Lù0­Úif4·è;h=ÚFýiC¤‘ Á¯žöó™àˆ¸…¡DrQqá+®0"Pêê&ÂQá7· F½@kTþ1¸ýQdQ1þùϯä*Š/ì¢SO$÷p÷¸Ýè5OÚwkÍÔR^³ž0$ë]—¨óM‚?Œ;»<Üvv®CÇ1âú252˜Çœ†ÜáþÆ$yœdHµ¨à݈ fêÏÁÀ ‹ ‹G÷¤£‘ŽS²PŠ·Ç{!«,ë8ƒ4AïGYò¬ CE*†³Yœ“Ìó ¹Ã.èXÃE\xY¡˜VCÊ/É;=†‚9cݽ¸ÝæaÍÚÑQB™²^ WjëÖÿÔYºEKÃ:ìhqnûÂ6Ha6fïK–³q}âÓŽ<â5†ìV7[ü¾Èëøû&Öe:®ÒéÉ/Ò ŠäLCšV2ÅHŽWýreÇ¿b!b~é=–i~:·úú-4å#2¥reˆâ ´•¸£TUê«ÕdÑH¾ƒª Þ¨lL1Ô§1V qéÃè×  0ù.ܶ°@­%èŸ.çÖ†¨<þ4UØãæ¥b‰öeÛs¥ÂÜ(U>ce"b¸Ic·þPK=-ðY&PKksU+gnu/regexp/RETokenEndSub.classePËNÂP=ë‚ÅGEEñ;@´î1.$˜TM„°ÐU¡—R… ©­á£Ü˜M\ø~”q.°ð1ÉÜ;3gΙ¹÷óëýQá@C„uehúÂã‘ySk„¬I§¶5ÄÆ”ØA§G0 Ö¸Ú³ýºtÄX8ëíRµWŠ·„Xuè²åIqÚÂoÚí¾Ð‘Â"!*¤CˆÜÕ“H#©aéïü©Ž¬Ãöt˜À¢:2 ˆ{ªª$Ötl"ÁS¥)~óÇN8rëÞ~²Í¾-]³øžtÏÃnWø•b‹8õ¤œqw¡^léÈaGÑw ©Æ0ô;âÂëó3Œ_ÿu¬q›D¡Lq$8×8Ês®*™òziƒïõëÒaùÙgÌl Ûóî4{„^æo0‡ ”(åÞ°7à ûSBþPK^ÃÜ…HÜPKksU+!gnu/regexp/RETokenLookAhead.class}R]OA=Óî²e]¥`AJë~nw ‹_¨­J°„¤b"–v( íl³lIÿJ/}1‘5ñÁøäƒ?Êx§%hu’ݹ÷œsÏÜ»¿ÿ|ÿ8æPÐcÈÔDË x·›ÎÇ•Mÿ‹²ï.ïs·ªAa˜0ÄÎ*¦Š Áknè‚í0¨ 7¬ì38æyxiß ÖD•·yµxQ潄sÄTJ~•DÆÊžàë­Æ.6ÝÝ:7p c¤[©ûBº0så÷Øuꮨ9vx%,êÇU —í÷Ä ¨Ãu£ÐuêÆ¤ »a`:¼ÊTÚÀMÜbÐÝ£#¯&V¿A(s¨é-Y7Käj«Ñ¤Þšçœm„'jïZ{{< d÷¨æ’xÈ0â6›\Tòƒœbî_2:LÜ×c˜Žê¶4Rú¯†e`³ šô½\¯Ë{Ï‘©×žð· Óæ°Qï䶨-+í o†ž/Ž4<##€gI X¤Æ˜k²Iq<'æ†ß *|Õ«Ó'/ÿ{óÒ.‘=44ÈEƒ¢·ŒÒð(…veöS>Bò'Æ×O¿…Të+Rö\„©fh?ÝïZvZ‰é@K+5­þBê,—O«n+Ý~@·lRËtã]ô×Ìž–]¤²ÒšeOÜðhÛî3ÉÙÏP“o"ä·{Å#8v2'_N5ð˜˜Oh§ÖÓžZ–"òZI+þ /,û„,eO0Ýç0¼ì5âÕ_PKêsÐ<ÁPKksU+gnu/regexp/RETokenOneOf.class}SßsUþ.»›ºM( m¨µQ˯„¨5*$)&Š%D›”±µnÈVX²t2Ž3¾äŸˆŽíŒÃKfœÎ4›ÑÌ8}ÒŸ}׿D<—%1mPf—{Ïù¾ï|çœßÿþùHǦ ÃŪÑN´x•o7·çW_rcÉàK*dïéKµÑ4õ†±E×Ù¥‡¥DÛÔk‰b|Q”Ünªù‚?ÜD½¥ÅEÂ%¥^2Ë$*Ξ(6½YjeŒ ßæ•Tö9Ex*RÔ Â)$†4\Á+¤‹x*:ãÂ^Vñê‹þõR5¼Žk CebÕÈTMú "xME”áÂ` \Ç•k ƒœ ´a q EÁ“ÞBH ¾mŠƒ7ÅÁå*Jè~[Ã{H2¸K[[zÕXh5ê4#áäÙ»„^i×› ð 9ËfK7ª7Û¼E‘NÌ28Öî91'ú?›ÔÆdC©ÙäF…!~:9ù/<7pSŇd×àžŠÒÿ‹ñ‘†,fh¢Esµšp艚¦y5o0\ gN«*#y 9|j÷./’>+½É΋¹ZV±ú|/ûÛ#ZêFA4»x4©'ÀÌç$ œIRk¾À}ÑJeÞÞ±§oßÓP>Tëíš ZýËœÞT" ØåF»Uæ zêÜÉýŸ ˜¤§Ùƒƒ¾´’½7š{z*ô£µ¢û3ô–¤s™žÞ³ÓÒ‚ѧ Y8ÿ ’…‹…™Àc(Á鉅ą—uÿ ìÁþдöq‰ÍEÏ)êò.Fcñ§¸úÂxcßC‘öXŽ%eiJíàŽò©6GR‰[H<ÃXÒéWb~§…7v1iƒPV´wt}!¿üÎú9¿3)w0ì—ýÎ}¼#þí¨Ì§‹ûaüWœ?Î[HÉ{}Qñ‰’ïïãj4F´×÷¤£B¦1Ó/¤J…ãÖbv’ÓK®(Þ÷-̯J3\Çßb8øÜ1Ï×>^ÜA»œ˜…Å ËùãÆs—`<ÿ¤OšÃRŸôuHôh68Àíè!F ¸³‘hh—¥)¥ƒžý‡ÈqŸbá3Ÿ|€»J; ó +ºý ÌûÀÁ~{=6püÒŽdØè FõPK5”%gÈ[PKksU+gnu/regexp/RETokenPOSIX.class}U[wUþ¦¹MÓÊÐZ 垤 h[ iÚB$McÓ i¡ešLÓd’ ¹ªˆ¼ß°õ¾ÈZ®¾¨´xY²|ñAÿ„¾¸ü¾‰{OR):Yçœý½÷·ÏÙ{Ïä׿¿¿ ¶á¦ UV¥õR  ¦Õ©| ¯«?wRÕc½ñðìäÅJŽ`$:Ð#@Û@€%¡œ^4ÝT2%Õ4ˆ ²R Ð F3 `ŽP´¿/ÂÀF 3|0ÜÏ€"9öc‡8Dz‡ºú8 ÄúÂQÓÌÅ` 2H  †ºTˆÅÊ>nÎ#÷¹kÔÇt%«ö+ã:ÝŠ‘È å´È(z:7 šžn`7ÎæIéÔô¢ªérÃ\ºšV 5%@Ôî_®Þ³ØÝ&‚P.EêeMW£¥ì¸Z0ãIX‡¦jJ’W‚Û(‚zª¤dŠõŽŸP“F«wØš]Ø! öá0´•VMײ¥lDÕÓÆ¤›‡ƒ;²Š‘$ðD, M*…°žR§ÔTkä_•ìasŠ&a™b­ªñžtáé‡ËnKhE>IœAƒ®ë {C5hG‹ û¬|tX*À½{ÖÃÉ)JèDåH+FTÃP ½…N-­™l!¾úA„\8D%zpu&S’d+áö|Ù:,¡‡7%­Ž÷R…\† 1V¸´¢÷z%Ä+ÆC“š¡óJReEŸ„ ØÈp„Mj(HîŒZ)EÓbHĈ€¦ã×ظióèŸÇ»ml_óȱsŽžomÙº!°ß¿½­]Â1ŒrP¾|ïD9Ia®èQ J…x Ÿ@|\u—¤Œ'SêD°#ÔÙÕ-aSù0Ô:“ØM$º:E°Àž*eó÷`GibB-´z%dA/©S¡8zŠmCÞÿ²v#Œ §¨~¶P•ÇÙFMg´›Ý6ÈNgT´p´³üz)þ/ꔈóDÐrLÂE\¢²¹…&¯ó,ö4}.Pj=áðð0_²ˆËùäÔ¼@ mÉŒyJ/SG+½”ñª)æ'×H'Γ"Þ 1IÍ’ñ‰)nï˜.(ùIáñ‰y:\g±¤'Iœ&Ñl “X⢊ø”R5•*·´;ž+’j·ÆßœåÖ/ëv¾vP‰ùûT‹ÕpÀIHäo$\„«-ØM¸Æ‚%ÂK,x)áeÌ|Ë-X&¼Â‚ë×[ðJ«,x5ý³àÇ 7Xð¼–0}âøŸ€ßss¥×É\7™«“,7c yl%ä'Ÿ*Z›lm·P÷5| ;}óØ> GÃìAh »Ÿßû³jåç ì¬x.¥Uà˜öÝ.ì.ë„k”K­—šý·±÷;ì«B{£|à&¶YÛ»ï6:¾äÿ£–Šg v4Fi4.иJã ?ÓøÆ_0C ë¿E÷ –4ÖŽÝ€Ëv vûû-üAÛ‡Yø­±¶é««­ê_Heá'žeá ý3XÊŠ™Šå´Åã:tpnæ-›%f,ꩲ;«£Ó®ÉnXnœÇXÕMË^7{°°oó¸•y-ŸpËåä" yNLcY½å¤,×ù”kûñ9ìõ5ûç¡ÍÚ s'+EÛ»Yî]ewsíèöîÏ)$œ§©hèS/‰N}êm¹6â[zŸduú8b§ÓÝ3²¡Œ¶‹þ_àý à)ßßOVùƒ™ôoûnz ¾[øé1rŸ¢O8Z?£õòÂX¸ ›ŒçL™Áß0r}gM]èBsð¢ª~£ÃªÌˆLVh{ȘQ}„hNDœÓ¶™ffDhf¨‹Ë"äàµß‘7 ›†ƒ w‘á}Ä…a†é‹taˆˆ0vaº§˜”®Ì~ïOR?C"´ßÛSITSˆ°©Ý 0Ÿ“"S|Ы¹¤¾G0°-t¢ÌäÌŒ13ÞŬГDnZÑXÇEü1áŠIÜäôÅ~LÄ}&1s 1¹í%£.FoGp·_îöð„ìSÿt|½oj€K¤!3C¹…..ŽùB¸øf” A…­™AO,C„„æc´ía‘YÛï=ÁŸý©Íâ’öõ‘½—x×Áü5Wh‹ÙDÚÁUõ³8P¾QÅ]û|êð-‰LÁDVÅtqÕ»Lªhí>bÙÄ„ç(f_9žÛÁu·š:ÿˆ3ÙDîŸúß«ºE“M|í;hY ¿ÒÁÎŽbÅç}Ö}ÀÉÌÐ>Éävi¡†wi?“$BÑ‹gøÔ•öÆßPKÉþ/*aPKksU+gnu/regexp/RETokenStart.classu“IoÓ@Çÿ“xÉbhº8¡¤a_²Q³³U@R¤À”"q@¸ñ$18Nä:'¾==õ‚J=päÀ/¼Irh›âÃÌ›y¿÷Ÿ÷æýÙù0. ¤"Äjz=ÃçMÞïî­t^r¯X~ Bb˜™t2¨í:'wõ…õÊ2\ËkµÀw¼f‰An[A½Å`d«»¢Ë-˯x6ïs»TÝ£ú@à¥ÜS©Ü±IuªJâ{í5î¯Xk.× C‰‚!®á0¦—{Í€Žgs•¦qHÅ Cb2æ Þi4ÖyÀÀ*Q¤0«âÈþʆ9h8*pÙi r^CÇH NÉß!)[É•ã8'’×'2ZÐpŠðx?ˆÑuŸÖp~˜ o¸Vs]ÈŸÓnY^½ÕñÅVŽ"ì^»ËÎNÜíÝ^£ÁýRnUƒ‹"®Ûåž-Ørît —±¨â e{0A:·Ï –‰ÈV&*Ž[µQñ«¢“!Vëôü:¿ï¸Ô¯éÝÏfQÐ QsC¢yd‰•ŠíDÉÚ¡u„æÏùmh?ÁÅ4@b¹¸df%S ›J–éŒýÇC0UÁèʧLYWuù¢aSÚBæ­ÂÆ ®<³º’Ùüû[—Þ!–/8û‰ˆl"ñæ=äðȾMöÛ^^âæ¼¶Tç*zábpñJ]«¶º€_Aß¿õÛ4*úmh£RiqK@O©)Yâ"sZÅ ÒŒR­aŠTHÅ9œ§T‰ªœ²¨’p>’éÆEœUp‰¡ïøFh »»*ˆPÑz«À-‹›Í¬^ÕmŽLdу®(ˆ3ô¾Ô^k‰ºfTm ­DX=puaXE7Tá%T\ƒ—N|ÅòÐ^%¿Ü^n2 † s–©Õt»Ráf*RtãƒãYÚÛÂ.©Ha\ôØlrƒ.(~ôl*ò?:&pGÁ=jüx„SBeÜŒ°$4®º%œp>¿)ªÈb¦3Ç¢èbšÁ3×h›%>­×éŽûy”#B £4ñ¾$ºJ.ŠÜâµA¡¸ëPì¡E3³}š"Yq꼄ð‘÷‹b…ìOç„3)Å·pÒ7¹ê›Ü@/ù´‚/èwæ†c"Ê_qÁ§IÙyù ¢ïq" ûž¯CqnB’’’<Œë?Gz®èF¤U‰ÔBkp¤µ}{G^•7ÐpÙùÐþÞ;{st Þ€ë/|5‹ïà:%œÑùnàæ^£YjÔAvL0»60ë°¸ýÉMÈþ±Ü]ØDЮh=1ÿd'ã‰ùÓÂû´Ç˜En1H|Y_tð3îGƒÛ‰†¶1ÚA2äí¡?øPKÔïÂ@ÉsPKesU+gnu/regexp/UncheckedRE.class‘Û/AÆ¿élm¬EÝŠºß[R„‰ÈJšÔ%[žd»&k¨©ÔVÊ?ä™MHx÷G‰³H,éƒy8sûï›3çíýéiÌéˆ0Ä=UËT…'ê—™åž ÷\œØ–¡=tg[ -kRI¡/™?s®LÙQ^f·t&\?›*2h›•ÁЙ—JìÔ.J¢ºï”Ê„6:¶­ãÂÑÎþÆáñžeçWH'ÿË¡p£|§žmE;Zut0ô4¹6EŒa¡ÉrMåREdN¥6KIÁ^ž @Žý`0‚Z¥S–·TQúßn¹Ü—L\ÇCâ'Ë®)_^«îŠK_V”‰Œ’'ümquåxdÓ›L…| ~U*/k`Ã:&~÷ʶBJQLýiÊwnð–&ɦP©U]±%Ëd 5z1ÈÁýG08­¢h¡¨Ó. šùþ³®ûO*`ºC ÿb†ÿ2±of™b”æñùúˆKsþˆÁ;t¯jÏH jk`úõžxÚ£š…ŠÌ~PKüÁ‹Ë’´PKdlÒ*$gnu/regexp/MessagesBundle.propertiesuRAnÜ0 ¼ûrIÔè9€Pä[Eû®D[Dlɥ䯛 %Ûë`ÜLÏpHqæ~E‹¿’‰#¥„=%è´èÃÜ õ´LMs¿…:^*ðçéi±4eŽáÒÑTvª,ó˜aЉ+ãíÇ;pUšP9Ñž‚L˜3Ix(òŸ5o'”DëJwÇ¡‰0·˜Iá™õ‡.Ÿã3à¯$ñû »ìáBÛû¬GäL:Nk¬à&‘½ªƒƒº3ìvÛJ4ÿf ™;&ÛŸßîßÞïà…³³>\È’ãЯš{k™yÞº¯ñ '}oa4s1[O®= Z2—j}…?S¾bèŸO½¤Î;µÎž§†ƒ^ÿ?åUœQgÈ–­´€ØÁŽ7vÐc~ÅÒ³êTeB¥5i>‹¿¢oðš€c…(ŽÄì%ŒxœÇbE/åTR¬)—ZÊÿ£¯fäèS~½"hJm YOÀÃ@½‚Ö¯‹jVƒKmñ«=éÁ’îíÍå 4Û²[@×|þ=«Þ²Ç±Iµl;8˜ ó˜ÔHuÔ‘CôÕT9‹!Ä\|£+ÉqÍPK®Ø,ÿ±€PKœsU+ META-INF/þÊPKœsU+Kù á=>=META-INF/MANIFEST.MFPKksU+îíhÃñ¼gnu/regexp/CharIndexed.classPKksU+H]–Pw(%Égnu/regexp/CharIndexedCharArray.classPKksU+†:4f'“gnu/regexp/CharIndexedInputStream.classPKksU+Ñá´ ‰l"ignu/regexp/CharIndexedReader.classPKksU+K£(i§"B gnu/regexp/CharIndexedString.classPKksU+zíNb ¡(9 gnu/regexp/CharIndexedStringBuffer.classPKksU+®e¹Îõ/gnu/regexp/CharUnit.classPKksU+O¹€Ï÷Dgnu/regexp/IntPair.classPKksU+ÈXξÑå1Ygnu/regexp/RE.classPKksU+2ü é k'gnu/regexp/REException.classPK»R‹*ÏN7Øñà$ž*gnu/regexp/REFilterInputStream.classPK³xŒ*÷‡évøá.gnu/regexp/REFilterReader.classPKksU+ ../.CONTENTS cd ../..; tar cvzf $(GNUREGEXPDIR).tar.gz -T $(GNUREGEXPDIR)/.CONTENTS javadocs: mkdir -p ${APIDOCSDIR} javadoc -d ${APIDOCSDIR} -author -version -public gnu.regexp gnu.regexp.util $(LIBDIR)/gnu-regexp-${GNUREGEXPVERSION}.jar: ${GNUREGEXPCLASSES} cd $(LIBDIR); jar cvf gnu-regexp-${GNUREGEXPVERSION}.jar gnu/regexp/*.class gnu/regexp/*.properties $(DOCSDIR)/gnu-regexp-applet.jar: ${GNUREGEXPCLASSES} $(LIBDIR)/gnu/regexp/util/REApplet.class cd $(LIBDIR); jar cvf gnu-regexp-applet.jar gnu/regexp/*.class gnu/regexp/*.properties gnu/regexp/util/REApplet.class; mv gnu-regexp-applet.jar $(DOCSDIR) # Special rules for gnu.regexp.IntPair and gnu.regexp.CharUnit inner classes # $(LIBDIR)/gnu/regexp/IntPair.class $(LIBDIR)/gnu/regexp/CharUnit.class $(LIBDIR)/gnu/regexp/RE.class : gnu/regexp/RE.java # Common rule for compiling a java file $(LIBDIR)/gnu/regexp/%.class: gnu/regexp/%.java $(JAVACOMPILE) $< # Properties files just get copied $(LIBDIR)/gnu/regexp/%.properties: gnu/regexp/%.properties cp $< $@ libgnu-regexp-java-1.1.4/src/gnu/0042755000175000000620000000000007617541044015744 5ustar killerstafflibgnu-regexp-java-1.1.4/src/gnu/regexp/0042755000175000000620000000000007617541044017236 5ustar killerstafflibgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexed.java0100644000175000000620000000513607364636622022265 0ustar killerstaff/* * gnu/regexp/CharIndexed.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; /** * Defines the interface used internally so that different types of source * text can be accessed in the same way. Built-in concrete classes provide * support for String, StringBuffer, InputStream and char[] types. * A class that is CharIndexed supports the notion of a cursor within a * block of text. The cursor must be able to be advanced via the move() * method. The charAt() method returns the character at the cursor position * plus a given offset. * * @author Wes Biggs */ public interface CharIndexed { /** * Defines a constant (0xFFFF was somewhat arbitrarily chosen) * that can be returned by the charAt() function indicating that * the specified index is out of range. */ char OUT_OF_BOUNDS = '\uFFFF'; /** * Returns the character at the given offset past the current cursor * position in the input. The index of the current position is zero. * It is possible for this method to be called with a negative index. * This happens when using the '^' operator in multiline matching mode * or the '\b' or '\<' word boundary operators. In any case, the lower * bound is currently fixed at -2 (for '^' with a two-character newline). * * @param index the offset position in the character field to examine * @return the character at the specified index, or the OUT_OF_BOUNDS * character defined by this interface. */ char charAt(int index); /** * Shifts the input buffer by a given number of positions. Returns * true if the new cursor position is valid. */ boolean move(int index); /** * Returns true if the most recent move() operation placed the cursor * position at a valid position in the input. */ boolean isValid(); } libgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexedCharArray.java0100644000175000000620000000253407265111125024043 0ustar killerstaff/* * gnu/regexp/CharIndexedCharArray.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; class CharIndexedCharArray implements CharIndexed, Serializable { private char[] s; private int anchor; CharIndexedCharArray(char[] str, int index) { s = str; anchor = index; } public char charAt(int index) { int pos = anchor + index; return ((pos < s.length) && (pos >= 0)) ? s[pos] : OUT_OF_BOUNDS; } public boolean isValid() { return (anchor < s.length); } public boolean move(int index) { return ((anchor += index) < s.length); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexedInputStream.java0100644000175000000620000000665607265111125024453 0ustar killerstaff/* * gnu/regexp/CharIndexedReader.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.IOException; // TODO: move(x) shouldn't rely on calling next() x times class CharIndexedInputStream implements CharIndexed { private static final int BUFFER_INCREMENT = 1024; private static final int UNKNOWN = Integer.MAX_VALUE; // value for end private BufferedInputStream br; // so that we don't try to reset() right away private int index = -1; private int bufsize = BUFFER_INCREMENT; private int end = UNKNOWN; private char cached = OUT_OF_BOUNDS; // Big enough for a \r\n pair // lookBehind[0] = most recent // lookBehind[1] = second most recent private char[] lookBehind = new char[] { OUT_OF_BOUNDS, OUT_OF_BOUNDS }; CharIndexedInputStream(InputStream str, int index) { if (str instanceof BufferedInputStream) br = (BufferedInputStream) str; else br = new BufferedInputStream(str,BUFFER_INCREMENT); next(); if (index > 0) move(index); } private boolean next() { if (end == 1) return false; end--; // closer to end try { if (index != -1) { br.reset(); } int i = br.read(); br.mark(bufsize); if (i == -1) { end = 1; cached = OUT_OF_BOUNDS; return false; } cached = (char) i; index = 1; } catch (IOException e) { e.printStackTrace(); cached = OUT_OF_BOUNDS; return false; } return true; } public char charAt(int index) { if (index == 0) { return cached; } else if (index >= end) { return OUT_OF_BOUNDS; } else if (index == -1) { return lookBehind[0]; } else if (index == -2) { return lookBehind[1]; } else if (index < -2) { return OUT_OF_BOUNDS; } else if (index >= bufsize) { // Allocate more space in the buffer. try { while (bufsize <= index) bufsize += BUFFER_INCREMENT; br.reset(); br.mark(bufsize); br.skip(index-1); } catch (IOException e) { } } else if (this.index != index) { try { br.reset(); br.skip(index-1); } catch (IOException e) { } } char ch = OUT_OF_BOUNDS; try { int i = br.read(); this.index = index+1; // this.index is index of next pos relative to charAt(0) if (i == -1) { // set flag that next should fail next time? end = index; return ch; } ch = (char) i; } catch (IOException ie) { } return ch; } public boolean move(int index) { // move read position [index] clicks from 'charAt(0)' boolean retval = true; while (retval && (index-- > 0)) retval = next(); return retval; } public boolean isValid() { return (cached != OUT_OF_BOUNDS); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexedString.java0100644000175000000620000000255707265111125023442 0ustar killerstaff/* * gnu/regexp/CharIndexedString.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; class CharIndexedString implements CharIndexed, Serializable { private String s; private int anchor; private int len; CharIndexedString(String str, int index) { s = str; len = s.length(); anchor = index; } public char charAt(int index) { int pos = anchor + index; return ((pos < len) && (pos >= 0)) ? s.charAt(pos) : OUT_OF_BOUNDS; } public boolean isValid() { return (anchor < len); } public boolean move(int index) { return ((anchor += index) < len); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexedStringBuffer.java0100644000175000000620000000256007265111125024566 0ustar killerstaff/* * gnu/regexp/CharIndexedStringBuffer.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; class CharIndexedStringBuffer implements CharIndexed, Serializable { private StringBuffer s; private int anchor; CharIndexedStringBuffer(StringBuffer str, int index) { s = str; anchor = index; } public char charAt(int index) { int pos = anchor + index; return ((pos < s.length()) && (pos >= 0)) ? s.charAt(pos) : OUT_OF_BOUNDS; } public boolean isValid() { return (anchor < s.length()); } public boolean move(int index) { return ((anchor += index) < s.length()); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RE.java0100644000175000000620000013740107364636622020416 0ustar killerstaff/* * gnu/regexp/RE.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.InputStream; import java.io.Reader; import java.io.Serializable; import java.util.Locale; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.Vector; class IntPair implements Serializable { public int first, second; } class CharUnit implements Serializable { public char ch; public boolean bk; } /** * RE provides the user interface for compiling and matching regular * expressions. *

    * A regular expression object (class RE) is compiled by constructing it * from a String, StringBuffer or character array, with optional * compilation flags (below) * and an optional syntax specification (see RESyntax; if not specified, * RESyntax.RE_SYNTAX_PERL5 is used). *

    * Various methods attempt to match input text against a compiled * regular expression. These methods are: *

  • isMatch: returns true if the input text in its entirety * matches the regular expression pattern. *
  • getMatch: returns the first match found in the input text, * or null if no match is found. *
  • getAllMatches: returns an array of all non-overlapping * matches found in the input text. If no matches are found, the array is * zero-length. *
  • substitute: substitute the first occurence of the pattern * in the input text with a replacement string (which may include * metacharacters $0-$9, see REMatch.substituteInto). *
  • substituteAll: same as above, but repeat for each match * before returning. *
  • getMatchEnumeration: returns an REMatchEnumeration object * that allows iteration over the matches (see REMatchEnumeration for some * reasons why you may want to do this instead of using getAllMatches. *

    * * These methods all have similar argument lists. The input can be a * String, a character array, a StringBuffer, a Reader or an * InputStream of some sort. Note that when using a Reader or * InputStream, the stream read position cannot be guaranteed after * attempting a match (this is not a bug, but a consequence of the way * regular expressions work). Using an REMatchEnumeration can * eliminate most positioning problems. * *

    * * The optional index argument specifies the offset from the beginning * of the text at which the search should start (see the descriptions * of some of the execution flags for how this can affect positional * pattern operators). For a Reader or InputStream, this means an * offset from the current read position, so subsequent calls with the * same index argument on a Reader or an InputStream will not * necessarily access the same position on the stream, whereas * repeated searches at a given index in a fixed string will return * consistent results. * *

    * You can optionally affect the execution environment by using a * combination of execution flags (constants listed below). * *

    * All operations on a regular expression are performed in a * thread-safe manner. * * @author Wes Biggs * @version 1.1.4-dev, to be released */ public class RE extends REToken { // This String will be returned by getVersion() private static final String VERSION = "1.1.4-dev"; // The localized strings are kept in a separate file private static ResourceBundle messages = PropertyResourceBundle.getBundle("gnu/regexp/MessagesBundle", Locale.getDefault()); // These are, respectively, the first and last tokens in our linked list // If there is only one token, firstToken == lastToken private REToken firstToken, lastToken; // This is the number of subexpressions in this regular expression, // with a minimum value of zero. Returned by getNumSubs() private int numSubs; /** Minimum length, in characters, of any possible match. */ private int minimumLength; /** * Compilation flag. Do not differentiate case. Subsequent * searches using this RE will be case insensitive. */ public static final int REG_ICASE = 2; /** * Compilation flag. The match-any-character operator (dot) * will match a newline character. When set this overrides the syntax * bit RE_DOT_NEWLINE (see RESyntax for details). This is equivalent to * the "/s" operator in Perl. */ public static final int REG_DOT_NEWLINE = 4; /** * Compilation flag. Use multiline mode. In this mode, the ^ and $ * anchors will match based on newlines within the input. This is * equivalent to the "/m" operator in Perl. */ public static final int REG_MULTILINE = 8; /** * Execution flag. * The match-beginning operator (^) will not match at the beginning * of the input string. Useful for matching on a substring when you * know the context of the input is such that position zero of the * input to the match test is not actually position zero of the text. *

    * This example demonstrates the results of various ways of matching on * a substring. *

    * * String s = "food bar fool";
    * RE exp = new RE("^foo.");
    * REMatch m0 = exp.getMatch(s);
    * REMatch m1 = exp.getMatch(s.substring(8));
    * REMatch m2 = exp.getMatch(s.substring(8),0,RE.REG_NOTBOL);
    * REMatch m3 = exp.getMatch(s,8);
    * REMatch m4 = exp.getMatch(s,8,RE.REG_ANCHORINDEX);
    *

    * // Results:
    * // m0 = "food"
    * // m1 = "fool"
    * // m2 = null
    * // m3 = null
    * // m4 = "fool"
    *
    */ public static final int REG_NOTBOL = 16; /** * Execution flag. * The match-end operator ($) does not match at the end * of the input string. Useful for matching on substrings. */ public static final int REG_NOTEOL = 32; /** * Execution flag. * When a match method is invoked that starts matching at a non-zero * index into the input, treat the input as if it begins at the index * given. The effect of this flag is that the engine does not "see" * any text in the input before the given index. This is useful so * that the match-beginning operator (^) matches not at position 0 * in the input string, but at the position the search started at * (based on the index input given to the getMatch function). See * the example under REG_NOTBOL. It also affects the use of the \< * and \b operators. */ public static final int REG_ANCHORINDEX = 64; /** * Execution flag. * The substitute and substituteAll methods will not attempt to * interpolate occurrences of $1-$9 in the replacement text with * the corresponding subexpressions. For example, you may want to * replace all matches of "one dollar" with "$1". */ public static final int REG_NO_INTERPOLATE = 128; /** Returns a string representing the version of the gnu.regexp package. */ public static final String version() { return VERSION; } // Retrieves a message from the ResourceBundle static final String getLocalizedMessage(String key) { return messages.getString(key); } /** * Constructs a regular expression pattern buffer without any compilation * flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5). * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer or char[]. Other input types will be converted to * strings using the toString() method. * @exception REException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public RE(Object pattern) throws REException { this(pattern,0,RESyntax.RE_SYNTAX_PERL5,0,0); } /** * Constructs a regular expression pattern buffer using the specified * compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5). * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer, or char[]. Other input types will be converted to * strings using the toString() method. * @param cflags The logical OR of any combination of the compilation flags listed above. * @exception REException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public RE(Object pattern, int cflags) throws REException { this(pattern,cflags,RESyntax.RE_SYNTAX_PERL5,0,0); } /** * Constructs a regular expression pattern buffer using the specified * compilation flags and regular expression syntax. * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer, or char[]. Other input types will be converted to * strings using the toString() method. * @param cflags The logical OR of any combination of the compilation flags listed above. * @param syntax The type of regular expression syntax to use. * @exception REException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public RE(Object pattern, int cflags, RESyntax syntax) throws REException { this(pattern,cflags,syntax,0,0); } // internal constructor used for alternation private RE(REToken first, REToken last,int subs, int subIndex, int minLength) { super(subIndex); firstToken = first; lastToken = last; numSubs = subs; minimumLength = minLength; addToken(new RETokenEndSub(subIndex)); } private RE(Object patternObj, int cflags, RESyntax syntax, int myIndex, int nextSub) throws REException { super(myIndex); // Subexpression index of this token. initialize(patternObj, cflags, syntax, myIndex, nextSub); } // For use by subclasses protected RE() { super(0); } // The meat of construction protected void initialize(Object patternObj, int cflags, RESyntax syntax, int myIndex, int nextSub) throws REException { char[] pattern; if (patternObj instanceof String) { pattern = ((String) patternObj).toCharArray(); } else if (patternObj instanceof char[]) { pattern = (char[]) patternObj; } else if (patternObj instanceof StringBuffer) { pattern = new char [((StringBuffer) patternObj).length()]; ((StringBuffer) patternObj).getChars(0,pattern.length,pattern,0); } else { pattern = patternObj.toString().toCharArray(); } int pLength = pattern.length; numSubs = 0; // Number of subexpressions in this token. Vector branches = null; // linked list of tokens (sort of -- some closed loops can exist) firstToken = lastToken = null; // Precalculate these so we don't pay for the math every time we // need to access them. boolean insens = ((cflags & REG_ICASE) > 0); // Parse pattern into tokens. Does anyone know if it's more efficient // to use char[] than a String.charAt()? I'm assuming so. // index tracks the position in the char array int index = 0; // this will be the current parse character (pattern[index]) CharUnit unit = new CharUnit(); // This is used for {x,y} calculations IntPair minMax = new IntPair(); // Buffer a token so we can create a TokenRepeated, etc. REToken currentToken = null; char ch; while (index < pLength) { // read the next character unit (including backslash escapes) index = getCharUnit(pattern,index,unit); // ALTERNATION OPERATOR // \| or | (if RE_NO_BK_VBAR) or newline (if RE_NEWLINE_ALT) // not available if RE_LIMITED_OPS is set // TODO: the '\n' literal here should be a test against REToken.newline, // which unfortunately may be more than a single character. if ( ( (unit.ch == '|' && (syntax.get(RESyntax.RE_NO_BK_VBAR) ^ unit.bk)) || (syntax.get(RESyntax.RE_NEWLINE_ALT) && (unit.ch == '\n') && !unit.bk) ) && !syntax.get(RESyntax.RE_LIMITED_OPS)) { // make everything up to here be a branch. create vector if nec. addToken(currentToken); RE theBranch = new RE(firstToken, lastToken, numSubs, subIndex, minimumLength); minimumLength = 0; if (branches == null) { branches = new Vector(); } branches.addElement(theBranch); firstToken = lastToken = currentToken = null; } // INTERVAL OPERATOR: // {x} | {x,} | {x,y} (RE_INTERVALS && RE_NO_BK_BRACES) // \{x\} | \{x,\} | \{x,y\} (RE_INTERVALS && !RE_NO_BK_BRACES) // // OPEN QUESTION: // what is proper interpretation of '{' at start of string? else if ((unit.ch == '{') && syntax.get(RESyntax.RE_INTERVALS) && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ unit.bk)) { int newIndex = getMinMax(pattern,index,minMax,syntax); if (newIndex > index) { if (minMax.first > minMax.second) throw new REException(getLocalizedMessage("interval.order"),REException.REG_BADRPT,newIndex); if (currentToken == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,newIndex); if (currentToken instanceof RETokenRepeated) throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,newIndex); if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary) throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,newIndex); if ((currentToken.getMinimumLength() == 0) && (minMax.second == Integer.MAX_VALUE)) throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,newIndex); index = newIndex; currentToken = setRepeated(currentToken,minMax.first,minMax.second,index); } else { addToken(currentToken); currentToken = new RETokenChar(subIndex,unit.ch,insens); } } // LIST OPERATOR: // [...] | [^...] else if ((unit.ch == '[') && !unit.bk) { Vector options = new Vector(); boolean negative = false; char lastChar = 0; if (index == pLength) throw new REException(getLocalizedMessage("unmatched.bracket"),REException.REG_EBRACK,index); // Check for initial caret, negation if ((ch = pattern[index]) == '^') { negative = true; if (++index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index); ch = pattern[index]; } // Check for leading right bracket literal if (ch == ']') { lastChar = ch; if (++index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index); } while ((ch = pattern[index++]) != ']') { if ((ch == '-') && (lastChar != 0)) { if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index); if ((ch = pattern[index]) == ']') { options.addElement(new RETokenChar(subIndex,lastChar,insens)); lastChar = '-'; } else { options.addElement(new RETokenRange(subIndex,lastChar,ch,insens)); lastChar = 0; index++; } } else if ((ch == '\\') && syntax.get(RESyntax.RE_BACKSLASH_ESCAPE_IN_LISTS)) { if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index); int posixID = -1; boolean negate = false; char asciiEsc = 0; if (("dswDSW".indexOf(pattern[index]) != -1) && syntax.get(RESyntax.RE_CHAR_CLASS_ESC_IN_LISTS)) { switch (pattern[index]) { case 'D': negate = true; case 'd': posixID = RETokenPOSIX.DIGIT; break; case 'S': negate = true; case 's': posixID = RETokenPOSIX.SPACE; break; case 'W': negate = true; case 'w': posixID = RETokenPOSIX.ALNUM; break; } } else if ("nrt".indexOf(pattern[index]) != -1) { switch (pattern[index]) { case 'n': asciiEsc = '\n'; break; case 't': asciiEsc = '\t'; break; case 'r': asciiEsc = '\r'; break; } } if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens)); if (posixID != -1) { options.addElement(new RETokenPOSIX(subIndex,posixID,insens,negate)); } else if (asciiEsc != 0) { lastChar = asciiEsc; } else { lastChar = pattern[index]; } ++index; } else if ((ch == '[') && (syntax.get(RESyntax.RE_CHAR_CLASSES)) && (index < pLength) && (pattern[index] == ':')) { StringBuffer posixSet = new StringBuffer(); index = getPosixSet(pattern,index+1,posixSet); int posixId = RETokenPOSIX.intValue(posixSet.toString()); if (posixId != -1) options.addElement(new RETokenPOSIX(subIndex,posixId,insens,false)); } else { if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens)); lastChar = ch; } if (index == pLength) throw new REException(getLocalizedMessage("class.no.end"),REException.REG_EBRACK,index); } // while in list // Out of list, index is one past ']' if (lastChar != 0) options.addElement(new RETokenChar(subIndex,lastChar,insens)); // Create a new RETokenOneOf addToken(currentToken); options.trimToSize(); currentToken = new RETokenOneOf(subIndex,options,negative); } // SUBEXPRESSIONS // (...) | \(...\) depending on RE_NO_BK_PARENS else if ((unit.ch == '(') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ unit.bk)) { boolean pure = false; boolean comment = false; boolean lookAhead = false; boolean negativelh = false; if ((index+1 < pLength) && (pattern[index] == '?')) { switch (pattern[index+1]) { case '!': if (syntax.get(RESyntax.RE_LOOKAHEAD)) { pure = true; negativelh = true; lookAhead = true; index += 2; } break; case '=': if (syntax.get(RESyntax.RE_LOOKAHEAD)) { pure = true; lookAhead = true; index += 2; } break; case ':': if (syntax.get(RESyntax.RE_PURE_GROUPING)) { pure = true; index += 2; } break; case '#': if (syntax.get(RESyntax.RE_COMMENTS)) { comment = true; } break; default: throw new REException(getLocalizedMessage("repeat.no.token"), REException.REG_BADRPT, index); } } if (index >= pLength) { throw new REException(getLocalizedMessage("unmatched.paren"), REException.REG_ESUBREG,index); } // find end of subexpression int endIndex = index; int nextIndex = index; int nested = 0; while ( ((nextIndex = getCharUnit(pattern,endIndex,unit)) > 0) && !(nested == 0 && (unit.ch == ')') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ unit.bk)) ) if ((endIndex = nextIndex) >= pLength) throw new REException(getLocalizedMessage("subexpr.no.end"),REException.REG_ESUBREG,nextIndex); else if (unit.ch == '(' && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ unit.bk)) nested++; else if (unit.ch == ')' && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ unit.bk)) nested--; // endIndex is now position at a ')','\)' // nextIndex is end of string or position after ')' or '\)' if (comment) index = nextIndex; else { // not a comment // create RE subexpression as token. addToken(currentToken); if (!pure) { numSubs++; } int useIndex = (pure || lookAhead) ? 0 : nextSub + numSubs; currentToken = new RE(String.valueOf(pattern,index,endIndex-index).toCharArray(),cflags,syntax,useIndex,nextSub + numSubs); numSubs += ((RE) currentToken).getNumSubs(); if (lookAhead) { currentToken = new RETokenLookAhead(currentToken,negativelh); } index = nextIndex; } // not a comment } // subexpression // UNMATCHED RIGHT PAREN // ) or \) throw exception if // !syntax.get(RESyntax.RE_UNMATCHED_RIGHT_PAREN_ORD) else if (!syntax.get(RESyntax.RE_UNMATCHED_RIGHT_PAREN_ORD) && ((unit.ch == ')') && (syntax.get(RESyntax.RE_NO_BK_PARENS) ^ unit.bk))) { throw new REException(getLocalizedMessage("unmatched.paren"),REException.REG_EPAREN,index); } // START OF LINE OPERATOR // ^ else if ((unit.ch == '^') && !unit.bk) { addToken(currentToken); currentToken = null; addToken(new RETokenStart(subIndex,((cflags & REG_MULTILINE) > 0) ? syntax.getLineSeparator() : null)); } // END OF LINE OPERATOR // $ else if ((unit.ch == '$') && !unit.bk) { addToken(currentToken); currentToken = null; addToken(new RETokenEnd(subIndex,((cflags & REG_MULTILINE) > 0) ? syntax.getLineSeparator() : null)); } // MATCH-ANY-CHARACTER OPERATOR (except possibly newline and null) // . else if ((unit.ch == '.') && !unit.bk) { addToken(currentToken); currentToken = new RETokenAny(subIndex,syntax.get(RESyntax.RE_DOT_NEWLINE) || ((cflags & REG_DOT_NEWLINE) > 0),syntax.get(RESyntax.RE_DOT_NOT_NULL)); } // ZERO-OR-MORE REPEAT OPERATOR // * else if ((unit.ch == '*') && !unit.bk) { if (currentToken == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index); if (currentToken instanceof RETokenRepeated) throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index); if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary) throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index); if (currentToken.getMinimumLength() == 0) throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,index); currentToken = setRepeated(currentToken,0,Integer.MAX_VALUE,index); } // ONE-OR-MORE REPEAT OPERATOR // + | \+ depending on RE_BK_PLUS_QM // not available if RE_LIMITED_OPS is set else if ((unit.ch == '+') && !syntax.get(RESyntax.RE_LIMITED_OPS) && (!syntax.get(RESyntax.RE_BK_PLUS_QM) ^ unit.bk)) { if (currentToken == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index); if (currentToken instanceof RETokenRepeated) throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index); if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary) throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index); if (currentToken.getMinimumLength() == 0) throw new REException(getLocalizedMessage("repeat.empty.token"),REException.REG_BADRPT,index); currentToken = setRepeated(currentToken,1,Integer.MAX_VALUE,index); } // ZERO-OR-ONE REPEAT OPERATOR / STINGY MATCHING OPERATOR // ? | \? depending on RE_BK_PLUS_QM // not available if RE_LIMITED_OPS is set // stingy matching if RE_STINGY_OPS is set and it follows a quantifier else if ((unit.ch == '?') && !syntax.get(RESyntax.RE_LIMITED_OPS) && (!syntax.get(RESyntax.RE_BK_PLUS_QM) ^ unit.bk)) { if (currentToken == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index); // Check for stingy matching on RETokenRepeated if (currentToken instanceof RETokenRepeated) { if (syntax.get(RESyntax.RE_STINGY_OPS) && !((RETokenRepeated)currentToken).isStingy()) ((RETokenRepeated)currentToken).makeStingy(); else throw new REException(getLocalizedMessage("repeat.chained"),REException.REG_BADRPT,index); } else if (currentToken instanceof RETokenWordBoundary || currentToken instanceof RETokenWordBoundary) throw new REException(getLocalizedMessage("repeat.assertion"),REException.REG_BADRPT,index); else currentToken = setRepeated(currentToken,0,1,index); } // BACKREFERENCE OPERATOR // \1 \2 ... \9 // not available if RE_NO_BK_REFS is set else if (unit.bk && Character.isDigit(unit.ch) && !syntax.get(RESyntax.RE_NO_BK_REFS)) { addToken(currentToken); currentToken = new RETokenBackRef(subIndex,Character.digit(unit.ch,10),insens); } // START OF STRING OPERATOR // \A if RE_STRING_ANCHORS is set else if (unit.bk && (unit.ch == 'A') && syntax.get(RESyntax.RE_STRING_ANCHORS)) { addToken(currentToken); currentToken = new RETokenStart(subIndex,null); } // WORD BREAK OPERATOR // \b if ???? else if (unit.bk && (unit.ch == 'b') && syntax.get(RESyntax.RE_STRING_ANCHORS)) { addToken(currentToken); currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN | RETokenWordBoundary.END, false); } // WORD BEGIN OPERATOR // \< if ???? else if (unit.bk && (unit.ch == '<')) { addToken(currentToken); currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN, false); } // WORD END OPERATOR // \> if ???? else if (unit.bk && (unit.ch == '>')) { addToken(currentToken); currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.END, false); } // NON-WORD BREAK OPERATOR // \B if ???? else if (unit.bk && (unit.ch == 'B') && syntax.get(RESyntax.RE_STRING_ANCHORS)) { addToken(currentToken); currentToken = new RETokenWordBoundary(subIndex, RETokenWordBoundary.BEGIN | RETokenWordBoundary.END, true); } // DIGIT OPERATOR // \d if RE_CHAR_CLASS_ESCAPES is set else if (unit.bk && (unit.ch == 'd') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,false); } // NON-DIGIT OPERATOR // \D else if (unit.bk && (unit.ch == 'D') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.DIGIT,insens,true); } // NEWLINE ESCAPE // \n else if (unit.bk && (unit.ch == 'n')) { addToken(currentToken); currentToken = new RETokenChar(subIndex,'\n',false); } // RETURN ESCAPE // \r else if (unit.bk && (unit.ch == 'r')) { addToken(currentToken); currentToken = new RETokenChar(subIndex,'\r',false); } // WHITESPACE OPERATOR // \s if RE_CHAR_CLASS_ESCAPES is set else if (unit.bk && (unit.ch == 's') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,false); } // NON-WHITESPACE OPERATOR // \S else if (unit.bk && (unit.ch == 'S') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.SPACE,insens,true); } // TAB ESCAPE // \t else if (unit.bk && (unit.ch == 't')) { addToken(currentToken); currentToken = new RETokenChar(subIndex,'\t',false); } // ALPHANUMERIC OPERATOR // \w else if (unit.bk && (unit.ch == 'w') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.ALNUM,insens,false); } // NON-ALPHANUMERIC OPERATOR // \W else if (unit.bk && (unit.ch == 'W') && syntax.get(RESyntax.RE_CHAR_CLASS_ESCAPES)) { addToken(currentToken); currentToken = new RETokenPOSIX(subIndex,RETokenPOSIX.ALNUM,insens,true); } // END OF STRING OPERATOR // \Z else if (unit.bk && (unit.ch == 'Z') && syntax.get(RESyntax.RE_STRING_ANCHORS)) { addToken(currentToken); currentToken = new RETokenEnd(subIndex,null); } // NON-SPECIAL CHARACTER (or escape to make literal) // c | \* for example else { // not a special character addToken(currentToken); currentToken = new RETokenChar(subIndex,unit.ch,insens); } } // end while // Add final buffered token and an EndSub marker addToken(currentToken); if (branches != null) { branches.addElement(new RE(firstToken,lastToken,numSubs,subIndex,minimumLength)); branches.trimToSize(); // compact the Vector minimumLength = 0; firstToken = lastToken = null; addToken(new RETokenOneOf(subIndex,branches,false)); } else addToken(new RETokenEndSub(subIndex)); } private static int getCharUnit(char[] input, int index, CharUnit unit) throws REException { unit.ch = input[index++]; if (unit.bk = (unit.ch == '\\')) if (index < input.length) unit.ch = input[index++]; else throw new REException(getLocalizedMessage("ends.with.backslash"),REException.REG_ESCAPE,index); return index; } /** * Checks if the regular expression matches the input in its entirety. * * @param input The input text. */ public boolean isMatch(Object input) { return isMatch(input,0,0); } /** * Checks if the input string, starting from index, is an exact match of * this regular expression. * * @param input The input text. * @param index The offset index at which the search should be begin. */ public boolean isMatch(Object input,int index) { return isMatch(input,index,0); } /** * Checks if the input, starting from index and using the specified * execution flags, is an exact match of this regular expression. * * @param input The input text. * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. */ public boolean isMatch(Object input,int index,int eflags) { return isMatchImpl(makeCharIndexed(input,index),index,eflags); } private boolean isMatchImpl(CharIndexed input, int index, int eflags) { if (firstToken == null) // Trivial case return (input.charAt(0) == CharIndexed.OUT_OF_BOUNDS); REMatch m = new REMatch(numSubs, index, eflags); if (firstToken.match(input, m)) { while (m != null) { if (input.charAt(m.index) == CharIndexed.OUT_OF_BOUNDS) { return true; } m = m.next; } } return false; } /** * Returns the maximum number of subexpressions in this regular expression. * If the expression contains branches, the value returned will be the * maximum subexpressions in any of the branches. */ public int getNumSubs() { return numSubs; } // Overrides REToken.setUncle void setUncle(REToken uncle) { if (lastToken != null) { lastToken.setUncle(uncle); } else super.setUncle(uncle); // to deal with empty subexpressions } // Overrides REToken.chain boolean chain(REToken next) { super.chain(next); setUncle(next); return true; } /** * Returns the minimum number of characters that could possibly * constitute a match of this regular expression. */ public int getMinimumLength() { return minimumLength; } /** * Returns an array of all matches found in the input. * * If the regular expression allows the empty string to match, it will * substitute matches at all positions except the end of the input. * * @param input The input text. * @return a non-null (but possibly zero-length) array of matches */ public REMatch[] getAllMatches(Object input) { return getAllMatches(input,0,0); } /** * Returns an array of all matches found in the input, * beginning at the specified index position. * * If the regular expression allows the empty string to match, it will * substitute matches at all positions except the end of the input. * * @param input The input text. * @param index The offset index at which the search should be begin. * @return a non-null (but possibly zero-length) array of matches */ public REMatch[] getAllMatches(Object input, int index) { return getAllMatches(input,index,0); } /** * Returns an array of all matches found in the input string, * beginning at the specified index position and using the specified * execution flags. * * If the regular expression allows the empty string to match, it will * substitute matches at all positions except the end of the input. * * @param input The input text. * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return a non-null (but possibly zero-length) array of matches */ public REMatch[] getAllMatches(Object input, int index, int eflags) { return getAllMatchesImpl(makeCharIndexed(input,index),index,eflags); } // this has been changed since 1.03 to be non-overlapping matches private REMatch[] getAllMatchesImpl(CharIndexed input, int index, int eflags) { Vector all = new Vector(); REMatch m = null; while ((m = getMatchImpl(input,index,eflags,null)) != null) { all.addElement(m); index = m.getEndIndex(); if (m.end[0] == 0) { // handle pathological case of zero-length match index++; input.move(1); } else { input.move(m.end[0]); } if (!input.isValid()) break; } REMatch[] mset = new REMatch[all.size()]; all.copyInto(mset); return mset; } /* Implements abstract method REToken.match() */ boolean match(CharIndexed input, REMatch mymatch) { if (firstToken == null) return next(input, mymatch); // Note the start of this subexpression mymatch.start[subIndex] = mymatch.index; return firstToken.match(input, mymatch); } /** * Returns the first match found in the input. If no match is found, * null is returned. * * @param input The input text. * @return An REMatch instance referencing the match, or null if none. */ public REMatch getMatch(Object input) { return getMatch(input,0,0); } /** * Returns the first match found in the input, beginning * the search at the specified index. If no match is found, * returns null. * * @param input The input text. * @param index The offset within the text to begin looking for a match. * @return An REMatch instance referencing the match, or null if none. */ public REMatch getMatch(Object input, int index) { return getMatch(input,index,0); } /** * Returns the first match found in the input, beginning * the search at the specified index, and using the specified * execution flags. If no match is found, returns null. * * @param input The input text. * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return An REMatch instance referencing the match, or null if none. */ public REMatch getMatch(Object input, int index, int eflags) { return getMatch(input,index,eflags,null); } /** * Returns the first match found in the input, beginning the search * at the specified index, and using the specified execution flags. * If no match is found, returns null. If a StringBuffer is * provided and is non-null, the contents of the input text from the * index to the beginning of the match (or to the end of the input, * if there is no match) are appended to the StringBuffer. * * @param input The input text. * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @param buffer The StringBuffer to save pre-match text in. * @return An REMatch instance referencing the match, or null if none. */ public REMatch getMatch(Object input, int index, int eflags, StringBuffer buffer) { return getMatchImpl(makeCharIndexed(input,index),index,eflags,buffer); } REMatch getMatchImpl(CharIndexed input, int anchor, int eflags, StringBuffer buffer) { // Create a new REMatch to hold results REMatch mymatch = new REMatch(numSubs, anchor, eflags); do { // Optimization: check if anchor + minimumLength > length if (minimumLength == 0 || input.charAt(minimumLength-1) != CharIndexed.OUT_OF_BOUNDS) { if (match(input, mymatch)) { // Find longest match of them all to observe leftmost longest REMatch longest = mymatch; while ((mymatch = mymatch.next) != null) { if (mymatch.index > longest.index) { longest = mymatch; } } longest.end[0] = longest.index; longest.finish(input); return longest; } } mymatch.clear(++anchor); // Append character to buffer if needed if (buffer != null && input.charAt(0) != CharIndexed.OUT_OF_BOUNDS) { buffer.append(input.charAt(0)); } } while (input.move(1)); return null; } /** * Returns an REMatchEnumeration that can be used to iterate over the * matches found in the input text. * * @param input The input text. * @return A non-null REMatchEnumeration instance. */ public REMatchEnumeration getMatchEnumeration(Object input) { return getMatchEnumeration(input,0,0); } /** * Returns an REMatchEnumeration that can be used to iterate over the * matches found in the input text. * * @param input The input text. * @param index The offset index at which the search should be begin. * @return A non-null REMatchEnumeration instance, with its input cursor * set to the index position specified. */ public REMatchEnumeration getMatchEnumeration(Object input, int index) { return getMatchEnumeration(input,index,0); } /** * Returns an REMatchEnumeration that can be used to iterate over the * matches found in the input text. * * @param input The input text. * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return A non-null REMatchEnumeration instance, with its input cursor * set to the index position specified. */ public REMatchEnumeration getMatchEnumeration(Object input, int index, int eflags) { return new REMatchEnumeration(this,makeCharIndexed(input,index),index,eflags); } /** * Substitutes the replacement text for the first match found in the input. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @return A String interpolating the substituted text. * @see REMatch#substituteInto */ public String substitute(Object input,String replace) { return substitute(input,replace,0,0); } /** * Substitutes the replacement text for the first match found in the input * beginning at the specified index position. Specifying an index * effectively causes the regular expression engine to throw away the * specified number of characters. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0); } /** * Substitutes the replacement text for the first match found in the input * string, beginning at the specified index position and using the * specified execution flags. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substitute(Object input,String replace,int index,int eflags) { return substituteImpl(makeCharIndexed(input,index),replace,index,eflags); } private String substituteImpl(CharIndexed input,String replace,int index,int eflags) { StringBuffer buffer = new StringBuffer(); REMatch m = getMatchImpl(input,index,eflags,buffer); if (m==null) return buffer.toString(); buffer.append( ((eflags & REG_NO_INTERPOLATE) > 0) ? replace : m.substituteInto(replace) ); if (input.move(m.end[0])) { do { buffer.append(input.charAt(0)); } while (input.move(1)); } return buffer.toString(); } /** * Substitutes the replacement text for each non-overlapping match found * in the input text. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @return A String interpolating the substituted text. * @see REMatch#substituteInto */ public String substituteAll(Object input,String replace) { return substituteAll(input,replace,0,0); } /** * Substitutes the replacement text for each non-overlapping match found * in the input text, starting at the specified index. * * If the regular expression allows the empty string to match, it will * substitute matches at all positions except the end of the input. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0); } /** * Substitutes the replacement text for each non-overlapping match found * in the input text, starting at the specified index and using the * specified execution flags. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substituteAll(Object input,String replace,int index,int eflags) { return substituteAllImpl(makeCharIndexed(input,index),replace,index,eflags); } private String substituteAllImpl(CharIndexed input,String replace,int index,int eflags) { StringBuffer buffer = new StringBuffer(); REMatch m; while ((m = getMatchImpl(input,index,eflags,buffer)) != null) { buffer.append( ((eflags & REG_NO_INTERPOLATE) > 0) ? replace : m.substituteInto(replace) ); index = m.getEndIndex(); if (m.end[0] == 0) { char ch = input.charAt(0); if (ch != CharIndexed.OUT_OF_BOUNDS) buffer.append(ch); input.move(1); } else { input.move(m.end[0]); } if (!input.isValid()) break; } return buffer.toString(); } /* Helper function for constructor */ private void addToken(REToken next) { if (next == null) return; minimumLength += next.getMinimumLength(); if (firstToken == null) { lastToken = firstToken = next; } else { // if chain returns false, it "rejected" the token due to // an optimization, and next was combined with lastToken if (lastToken.chain(next)) { lastToken = next; } } } private static REToken setRepeated(REToken current, int min, int max, int index) throws REException { if (current == null) throw new REException(getLocalizedMessage("repeat.no.token"),REException.REG_BADRPT,index); return new RETokenRepeated(current.subIndex,current,min,max); } private static int getPosixSet(char[] pattern,int index,StringBuffer buf) { // Precondition: pattern[index-1] == ':' // we will return pos of closing ']'. int i; for (i=index; i<(pattern.length-1); i++) { if ((pattern[i] == ':') && (pattern[i+1] == ']')) return i+2; buf.append(pattern[i]); } return index; // didn't match up } private int getMinMax(char[] input,int index,IntPair minMax,RESyntax syntax) throws REException { // Precondition: input[index-1] == '{', minMax != null boolean mustMatch = !syntax.get(RESyntax.RE_NO_BK_BRACES); int startIndex = index; if (index == input.length) { if (mustMatch) throw new REException(getLocalizedMessage("unmatched.brace"),REException.REG_EBRACE,index); else return startIndex; } int min,max=0; CharUnit unit = new CharUnit(); StringBuffer buf = new StringBuffer(); // Read string of digits do { index = getCharUnit(input,index,unit); if (Character.isDigit(unit.ch)) buf.append(unit.ch); } while ((index != input.length) && Character.isDigit(unit.ch)); // Check for {} tomfoolery if (buf.length() == 0) { if (mustMatch) throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index); else return startIndex; } min = Integer.parseInt(buf.toString()); if ((unit.ch == '}') && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ unit.bk)) max = min; else if (index == input.length) if (mustMatch) throw new REException(getLocalizedMessage("interval.no.end"),REException.REG_EBRACE,index); else return startIndex; else if ((unit.ch == ',') && !unit.bk) { buf = new StringBuffer(); // Read string of digits while (((index = getCharUnit(input,index,unit)) != input.length) && Character.isDigit(unit.ch)) buf.append(unit.ch); if (!((unit.ch == '}') && (syntax.get(RESyntax.RE_NO_BK_BRACES) ^ unit.bk))) if (mustMatch) throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index); else return startIndex; // This is the case of {x,} if (buf.length() == 0) max = Integer.MAX_VALUE; else max = Integer.parseInt(buf.toString()); } else if (mustMatch) throw new REException(getLocalizedMessage("interval.error"),REException.REG_EBRACE,index); else return startIndex; // We know min and max now, and they are valid. minMax.first = min; minMax.second = max; // return the index following the '}' return index; } /** * Return a human readable form of the compiled regular expression, * useful for debugging. */ public String toString() { StringBuffer sb = new StringBuffer(); dump(sb); return sb.toString(); } void dump(StringBuffer os) { os.append('('); if (subIndex == 0) os.append("?:"); if (firstToken != null) firstToken.dumpAll(os); os.append(')'); } // Cast input appropriately or throw exception private static CharIndexed makeCharIndexed(Object input, int index) { // We could let a String fall through to final input, but since // it's the most likely input type, we check it first. if (input instanceof String) return new CharIndexedString((String) input,index); else if (input instanceof char[]) return new CharIndexedCharArray((char[]) input,index); else if (input instanceof StringBuffer) return new CharIndexedStringBuffer((StringBuffer) input,index); else if (input instanceof InputStream) return new CharIndexedInputStream((InputStream) input,index); else if (input instanceof Reader) return new CharIndexedReader((Reader) input, index); else if (input instanceof CharIndexed) return (CharIndexed) input; // do we lose index info? else return new CharIndexedString(input.toString(), index); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REException.java0100644000175000000620000001027607313462717022271 0ustar killerstaff/* * gnu/regexp/REException.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.text.MessageFormat; /** * This is the regular expression exception class. An exception of this type * defines the three attributes: *

      *
    1. A descriptive message of the error. *
    2. An integral type code equivalent to one of the statically * defined symbols listed below. *
    3. The approximate position in the input string where the error * occurred. *
    * * @author Wes Biggs */ public class REException extends Exception { private int type; private int pos; // Error conditions from GNU regcomp(3) manual /** * Error flag. * Invalid use of repetition operators such as using * `*' as the first character. */ public static final int REG_BADRPT = 1; /** * Error flag. * Invalid use of back reference operator. */ public static final int REG_BADBR = 2; /** * Error flag. * Un-matched brace interval operators. */ public static final int REG_EBRACE = 3; /** * Error flag. * Un-matched bracket list operators. */ public static final int REG_EBRACK = 4; /** * Error flag. * Invalid use of the range operator, eg. the ending * point of the range occurs prior to the starting * point. */ public static final int REG_ERANGE = 5; /** * Error flag. * Unknown character class name. Not implemented. */ public static final int REG_ECTYPE = 6; /** * Error flag. * Un-matched parenthesis group operators. */ public static final int REG_EPAREN = 7; /** * Error flag. * Invalid back reference to a subexpression. */ public static final int REG_ESUBREG = 8; /** * Error flag. * Non specific error. Not implemented. */ public static final int REG_EEND = 9; /** * Error flag. * Invalid escape sequence. Not implemented. */ public static final int REG_ESCAPE = 10; /** * Error flag. * Invalid use of pattern operators such as group or list. */ public static final int REG_BADPAT = 11; /** * Error flag. * Compiled regular expression requires a pattern * buffer larger than 64Kb. Not implemented. */ public static final int REG_ESIZE = 12; /** * Error flag. * The regex routines ran out of memory. Not implemented. */ public static final int REG_ESPACE = 13; REException(String msg, int type, int position) { super(msg); this.type = type; this.pos = position; } /** * Returns the type of the exception, one of the constants listed above. */ public int getType() { return type; } /** * Returns the position, relative to the string or character array being * compiled, where the error occurred. This position is generally the point * where the error was detected, not necessarily the starting index of * a bad subexpression. */ public int getPosition() { return pos; } /** * Reports the descriptive message associated with this exception * as well as its index position in the string or character array * being compiled. */ public String getMessage() { Object[] args = {new Integer(pos)}; StringBuffer sb = new StringBuffer(); String prefix = RE.getLocalizedMessage("error.prefix"); sb.append(MessageFormat.format(prefix, args)); sb.append('\n'); sb.append(super.getMessage()); return sb.toString(); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REFilterInputStream.java0100644000175000000620000000736707265111126023752 0ustar killerstaff/* * gnu/regexp/REFilterInputStream.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.FilterInputStream; import java.io.InputStream; /** * Replaces instances of a given RE found within an InputStream * with replacement text. The replacements are interpolated into the * stream when a match is found. * * @author Wes Biggs * @deprecated This class cannot properly handle all character * encodings. For proper handling, use the REFilterReader * class instead. */ public class REFilterInputStream extends FilterInputStream { private RE expr; private String replace; private String buffer; private int bufpos; private int offset; private CharIndexedInputStream stream; /** * Creates an REFilterInputStream. When reading from this stream, * occurrences of patterns matching the supplied regular expression * will be replaced with the supplied replacement text (the * metacharacters $0 through $9 may be used to refer to the full * match or subexpression matches). * * @param stream The InputStream to be filtered. * @param expr The regular expression to search for. * @param replace The text pattern to replace matches with. */ public REFilterInputStream(InputStream stream, RE expr, String replace) { super(stream); this.stream = new CharIndexedInputStream(stream,0); this.expr = expr; this.replace = replace; } /** * Reads the next byte from the stream per the general contract of * InputStream.read(). Returns -1 on error or end of stream. */ public int read() { // If we have buffered replace data, use it. if ((buffer != null) && (bufpos < buffer.length())) { return (int) buffer.charAt(bufpos++); } // check if input is at a valid position if (!stream.isValid()) return -1; REMatch mymatch = new REMatch(expr.getNumSubs(),offset,0); if (expr.match(stream, mymatch)) { mymatch.end[0] = mymatch.index; mymatch.finish(stream); stream.move(mymatch.toString().length()); offset += mymatch.toString().length(); buffer = mymatch.substituteInto(replace); bufpos = 1; // This is prone to infinite loops if replace string turns out empty. if (buffer.length() > 0) { return buffer.charAt(0); } } char ch = stream.charAt(0); if (ch == CharIndexed.OUT_OF_BOUNDS) return -1; stream.move(1); offset++; return ch; } /** * Returns false. REFilterInputStream does not support mark() and * reset() methods. */ public boolean markSupported() { return false; } /** Reads from the stream into the provided array. */ public int read(byte[] b, int off, int len) { int i; int ok = 0; while (len-- > 0) { i = read(); if (i == -1) return (ok == 0) ? -1 : ok; b[off++] = (byte) i; ok++; } return ok; } /** Reads from the stream into the provided array. */ public int read(byte[] b) { return read(b,0,b.length); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REMatch.java0100644000175000000620000001751007364636622021371 0ustar killerstaff/* * gnu/regexp/REMatch.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; /** * An instance of this class represents a match * completed by a gnu.regexp matching function. It can be used * to obtain relevant information about the location of a match * or submatch. * * @author Wes Biggs */ public final class REMatch implements Serializable, Cloneable { private String matchedText; // These variables are package scope for fast access within the engine int eflags; // execution flags this match was made using // Offset in source text where match was tried. This is zero-based; // the actual position in the source text is given by (offset + anchor). int offset; // Anchor position refers to the index into the source input // at which the matching operation began. // This is also useful for the ANCHORINDEX option. int anchor; // Package scope; used by RE. int index; // used while matching to mark current match position in input int[] start; // start positions (relative to offset) for each (sub)exp. int[] end; // end positions for the same REMatch next; // other possibility (to avoid having to use arrays) public Object clone() { try { REMatch copy = (REMatch) super.clone(); copy.next = null; copy.start = (int[]) start.clone(); copy.end = (int[]) end.clone(); return copy; } catch (CloneNotSupportedException e) { throw new Error(); // doesn't happen } } void assignFrom(REMatch other) { start = other.start; end = other.end; index = other.index; // need to deep clone? next = other.next; } REMatch(int subs, int anchor, int eflags) { start = new int[subs+1]; end = new int[subs+1]; this.anchor = anchor; this.eflags = eflags; clear(anchor); } void finish(CharIndexed text) { start[0] = 0; StringBuffer sb = new StringBuffer(); int i; for (i = 0; i < end[0]; i++) sb.append(text.charAt(i)); matchedText = sb.toString(); for (i = 0; i < start.length; i++) { // If any subexpressions didn't terminate, they don't count // TODO check if this code ever gets hit if ((start[i] == -1) ^ (end[i] == -1)) { start[i] = -1; end[i] = -1; } } next = null; // cut off alternates } /** Clears the current match and moves the offset to the new index. */ void clear(int index) { offset = index; this.index = 0; for (int i = 0; i < start.length; i++) { start[i] = end[i] = -1; } next = null; // cut off alternates } /** * Returns the string matching the pattern. This makes it convenient * to write code like the following: *

    * * REMatch myMatch = myExpression.getMatch(myString);
    * if (myMatch != null) System.out.println("Regexp found: "+myMatch); *
    */ public String toString() { return matchedText; } /** * Returns the index within the input text where the match in its entirety * began. */ public int getStartIndex() { return offset + start[0]; } /** * Returns the index within the input string where the match in * its entirety ends. The return value is the next position after * the end of the string; therefore, a match created by the * following call: * *

    * REMatch myMatch = myExpression.getMatch(myString); *

    * can be viewed (given that myMatch is not null) by creating *

    * String theMatch = myString.substring(myMatch.getStartIndex(), * myMatch.getEndIndex()); *

    * But you can save yourself that work, since the toString() * method (above) does exactly that for you. */ public int getEndIndex() { return offset + end[0]; } /** * Returns the string matching the given subexpression. The subexpressions * are indexed starting with one, not zero. That is, the subexpression * identified by the first set of parentheses in a regular expression * could be retrieved from an REMatch by calling match.toString(1). * * @param sub Index of the subexpression. */ public String toString(int sub) { if ((sub >= start.length) || (start[sub] == -1)) return ""; return (matchedText.substring(start[sub],end[sub])); } /** * Returns the index within the input string used to generate this match * where subexpression number sub begins, or -1 if * the subexpression does not exist. The initial position is zero. * * @param sub Subexpression index * @deprecated Use getStartIndex(int) instead. */ public int getSubStartIndex(int sub) { if (sub >= start.length) return -1; int x = start[sub]; return (x == -1) ? x : offset + x; } /** * Returns the index within the input string used to generate this match * where subexpression number sub begins, or -1 if * the subexpression does not exist. The initial position is zero. * * @param sub Subexpression index * @since gnu.regexp 1.1.0 */ public int getStartIndex(int sub) { if (sub >= start.length) return -1; int x = start[sub]; return (x == -1) ? x : offset + x; } /** * Returns the index within the input string used to generate this match * where subexpression number sub ends, or -1 if * the subexpression does not exist. The initial position is zero. * * @param sub Subexpression index * @deprecated Use getEndIndex(int) instead */ public int getSubEndIndex(int sub) { if (sub >= start.length) return -1; int x = end[sub]; return (x == -1) ? x : offset + x; } /** * Returns the index within the input string used to generate this match * where subexpression number sub ends, or -1 if * the subexpression does not exist. The initial position is zero. * * @param sub Subexpression index */ public int getEndIndex(int sub) { if (sub >= start.length) return -1; int x = end[sub]; return (x == -1) ? x : offset + x; } /** * Substitute the results of this match to create a new string. * This is patterned after PERL, so the tokens to watch out for are * $0 through $9. $0 matches * the full substring matched; $n matches * subexpression number n. * * @param input A string consisting of literals and $n tokens. */ public String substituteInto(String input) { // a la Perl, $0 is whole thing, $1 - $9 are subexpressions StringBuffer output = new StringBuffer(); int pos; for (pos = 0; pos < input.length()-1; pos++) { if ((input.charAt(pos) == '$') && (Character.isDigit(input.charAt(pos+1)))) { int val = Character.digit(input.charAt(++pos),10); if (val < start.length) { output.append(toString(val)); } } else output.append(input.charAt(pos)); } if (pos < input.length()) output.append(input.charAt(pos)); return output.toString(); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REMatchEnumeration.java0100644000175000000620000000747507364636622023611 0ustar killerstaff/* * gnu/regexp/REMatchEnumeration.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; import java.util.Enumeration; import java.util.NoSuchElementException; /** * An REMatchEnumeration enumerates regular expression matches over a * given input text. You obtain a reference to an enumeration using * the getMatchEnumeration() methods on an instance of * RE. * *

    * * REMatchEnumeration does lazy computation; that is, it will not * search for a match until it needs to. If you'd rather just get all * the matches at once in a big array, use the * getAllMatches() methods on RE. However, using an * enumeration can help speed performance when the entire text does * not need to be searched immediately. * *

    * * The enumerated type is especially useful when searching on a Reader * or InputStream, because the InputStream read position cannot be * guaranteed after calling getMatch() (see the * description of that method for an explanation of why). Enumeration * also saves a lot of overhead required when calling * getMatch() multiple times. * * @author Wes Biggs */ public class REMatchEnumeration implements Enumeration, Serializable { private static final int YES = 1; private static final int MAYBE = 0; private static final int NO = -1; private int more; private REMatch match; private RE expr; private CharIndexed input; private int eflags; private int index; // Package scope constructor is used by RE.getMatchEnumeration() REMatchEnumeration(RE expr, CharIndexed input, int index, int eflags) { more = MAYBE; this.expr = expr; this.input = input; this.index = index; this.eflags = eflags; } /** Returns true if there are more matches in the input text. */ public boolean hasMoreElements() { return hasMoreMatches(null); } /** Returns true if there are more matches in the input text. */ public boolean hasMoreMatches() { return hasMoreMatches(null); } /** Returns true if there are more matches in the input text. * Saves the text leading up to the match (or to the end of the input) * in the specified buffer. */ public boolean hasMoreMatches(StringBuffer buffer) { if (more == MAYBE) { match = expr.getMatchImpl(input,index,eflags,buffer); if (match != null) { input.move((match.end[0] > 0) ? match.end[0] : 1); index = (match.end[0] > 0) ? match.end[0] + match.offset : index + 1; more = YES; } else more = NO; } return (more == YES); } /** Returns the next match in the input text. */ public Object nextElement() throws NoSuchElementException { return nextMatch(); } /** * Returns the next match in the input text. This method is provided * for convenience to avoid having to explicitly cast the return value * to class REMatch. */ public REMatch nextMatch() throws NoSuchElementException { if (hasMoreElements()) { more = (input.isValid()) ? MAYBE : NO; return match; } throw new NoSuchElementException(); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RESyntax.java0100644000175000000620000003411107364636622021617 0ustar killerstaff/* * gnu/regexp/RESyntax.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; import java.util.BitSet; /** * An RESyntax specifies the way a regular expression will be compiled. * This class provides a number of predefined useful constants for * emulating popular regular expression syntaxes. Additionally the * user may construct his or her own syntax, using any combination of the * syntax bit constants. The syntax is an optional argument to any of the * matching methods on class RE. * * @author Wes Biggs */ public final class RESyntax implements Serializable { static final String DEFAULT_LINE_SEPARATOR = System.getProperty("line.separator"); private static final String SYNTAX_IS_FINAL = RE.getLocalizedMessage("syntax.final"); private BitSet bits; // true for the constant defined syntaxes private boolean isFinal = false; private String lineSeparator = DEFAULT_LINE_SEPARATOR; // Values for constants are bit indexes /** * Syntax bit. Backslash is an escape character in lists. */ public static final int RE_BACKSLASH_ESCAPE_IN_LISTS = 0; /** * Syntax bit. Use \? instead of ? and \+ instead of +. */ public static final int RE_BK_PLUS_QM = 1; /** * Syntax bit. POSIX character classes ([:...:]) in lists are allowed. */ public static final int RE_CHAR_CLASSES = 2; /** * Syntax bit. ^ and $ are special everywhere. * Not implemented. */ public static final int RE_CONTEXT_INDEP_ANCHORS = 3; /** * Syntax bit. Repetition operators are only special in valid positions. * Not implemented. */ public static final int RE_CONTEXT_INDEP_OPS = 4; /** * Syntax bit. Repetition and alternation operators are invalid * at start and end of pattern and other places. * Not implemented. */ public static final int RE_CONTEXT_INVALID_OPS = 5; /** * Syntax bit. Match-any-character operator (.) matches a newline. */ public static final int RE_DOT_NEWLINE = 6; /** * Syntax bit. Match-any-character operator (.) does not match a null. */ public static final int RE_DOT_NOT_NULL = 7; /** * Syntax bit. Intervals ({x}, {x,}, {x,y}) are allowed. */ public static final int RE_INTERVALS = 8; /** * Syntax bit. No alternation (|), match one-or-more (+), or * match zero-or-one (?) operators. */ public static final int RE_LIMITED_OPS = 9; /** * Syntax bit. Newline is an alternation operator. */ public static final int RE_NEWLINE_ALT = 10; // impl. /** * Syntax bit. Intervals use { } instead of \{ \} */ public static final int RE_NO_BK_BRACES = 11; /** * Syntax bit. Grouping uses ( ) instead of \( \). */ public static final int RE_NO_BK_PARENS = 12; /** * Syntax bit. Backreferences not allowed. */ public static final int RE_NO_BK_REFS = 13; /** * Syntax bit. Alternation uses | instead of \| */ public static final int RE_NO_BK_VBAR = 14; /** * Syntax bit. Not implemented. */ public static final int RE_NO_EMPTY_RANGES = 15; /** * Syntax bit. An unmatched right parenthesis (')' or '\)', depending * on RE_NO_BK_PARENS) will throw an exception when compiling. */ public static final int RE_UNMATCHED_RIGHT_PAREN_ORD = 16; /** * Syntax bit. Not implemented. */ public static final int RE_HAT_LISTS_NOT_NEWLINE = 17; /** * Syntax bit. Stingy matching is allowed (+?, *?, ??, {x,y}?). */ public static final int RE_STINGY_OPS = 18; /** * Syntax bit. Allow character class escapes (\d, \D, \s, \S, \w, \W). */ public static final int RE_CHAR_CLASS_ESCAPES = 19; /** * Syntax bit. Allow use of (?:xxx) grouping (subexpression is not saved). */ public static final int RE_PURE_GROUPING = 20; /** * Syntax bit. Allow use of (?=xxx) and (?!xxx) apply the subexpression * to the text following the current position without consuming that text. */ public static final int RE_LOOKAHEAD = 21; /** * Syntax bit. Allow beginning- and end-of-string anchors (\A, \Z). */ public static final int RE_STRING_ANCHORS = 22; /** * Syntax bit. Allow embedded comments, (?#comment), as in Perl5. */ public static final int RE_COMMENTS = 23; /** * Syntax bit. Allow character class escapes within lists, as in Perl5. */ public static final int RE_CHAR_CLASS_ESC_IN_LISTS = 24; private static final int BIT_TOTAL = 25; /** * Predefined syntax. * Emulates regular expression support in the awk utility. */ public static final RESyntax RE_SYNTAX_AWK; /** * Predefined syntax. * Emulates regular expression support in the ed utility. */ public static final RESyntax RE_SYNTAX_ED; /** * Predefined syntax. * Emulates regular expression support in the egrep utility. */ public static final RESyntax RE_SYNTAX_EGREP; /** * Predefined syntax. * Emulates regular expression support in the GNU Emacs editor. */ public static final RESyntax RE_SYNTAX_EMACS; /** * Predefined syntax. * Emulates regular expression support in the grep utility. */ public static final RESyntax RE_SYNTAX_GREP; /** * Predefined syntax. * Emulates regular expression support in the POSIX awk specification. */ public static final RESyntax RE_SYNTAX_POSIX_AWK; /** * Predefined syntax. * Emulates POSIX basic regular expression support. */ public static final RESyntax RE_SYNTAX_POSIX_BASIC; /** * Predefined syntax. * Emulates regular expression support in the POSIX egrep specification. */ public static final RESyntax RE_SYNTAX_POSIX_EGREP; /** * Predefined syntax. * Emulates POSIX extended regular expression support. */ public static final RESyntax RE_SYNTAX_POSIX_EXTENDED; /** * Predefined syntax. * Emulates POSIX basic minimal regular expressions. */ public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_BASIC; /** * Predefined syntax. * Emulates POSIX extended minimal regular expressions. */ public static final RESyntax RE_SYNTAX_POSIX_MINIMAL_EXTENDED; /** * Predefined syntax. * Emulates regular expression support in the sed utility. */ public static final RESyntax RE_SYNTAX_SED; /** * Predefined syntax. * Emulates regular expression support in Larry Wall's perl, version 4, */ public static final RESyntax RE_SYNTAX_PERL4; /** * Predefined syntax. * Emulates regular expression support in Larry Wall's perl, version 4, * using single line mode (/s modifier). */ public static final RESyntax RE_SYNTAX_PERL4_S; // single line mode (/s) /** * Predefined syntax. * Emulates regular expression support in Larry Wall's perl, version 5. */ public static final RESyntax RE_SYNTAX_PERL5; /** * Predefined syntax. * Emulates regular expression support in Larry Wall's perl, version 5, * using single line mode (/s modifier). */ public static final RESyntax RE_SYNTAX_PERL5_S; static { // Define syntaxes RE_SYNTAX_EMACS = new RESyntax().makeFinal(); RESyntax RE_SYNTAX_POSIX_COMMON = new RESyntax() .set(RE_CHAR_CLASSES) .set(RE_DOT_NEWLINE) .set(RE_DOT_NOT_NULL) .set(RE_INTERVALS) .set(RE_NO_EMPTY_RANGES) .makeFinal(); RE_SYNTAX_POSIX_BASIC = new RESyntax(RE_SYNTAX_POSIX_COMMON) .set(RE_BK_PLUS_QM) .makeFinal(); RE_SYNTAX_POSIX_EXTENDED = new RESyntax(RE_SYNTAX_POSIX_COMMON) .set(RE_CONTEXT_INDEP_ANCHORS) .set(RE_CONTEXT_INDEP_OPS) .set(RE_NO_BK_BRACES) .set(RE_NO_BK_PARENS) .set(RE_NO_BK_VBAR) .set(RE_UNMATCHED_RIGHT_PAREN_ORD) .makeFinal(); RE_SYNTAX_AWK = new RESyntax() .set(RE_BACKSLASH_ESCAPE_IN_LISTS) .set(RE_DOT_NOT_NULL) .set(RE_NO_BK_PARENS) .set(RE_NO_BK_REFS) .set(RE_NO_BK_VBAR) .set(RE_NO_EMPTY_RANGES) .set(RE_UNMATCHED_RIGHT_PAREN_ORD) .makeFinal(); RE_SYNTAX_POSIX_AWK = new RESyntax(RE_SYNTAX_POSIX_EXTENDED) .set(RE_BACKSLASH_ESCAPE_IN_LISTS) .makeFinal(); RE_SYNTAX_GREP = new RESyntax() .set(RE_BK_PLUS_QM) .set(RE_CHAR_CLASSES) .set(RE_HAT_LISTS_NOT_NEWLINE) .set(RE_INTERVALS) .set(RE_NEWLINE_ALT) .makeFinal(); RE_SYNTAX_EGREP = new RESyntax() .set(RE_CHAR_CLASSES) .set(RE_CONTEXT_INDEP_ANCHORS) .set(RE_CONTEXT_INDEP_OPS) .set(RE_HAT_LISTS_NOT_NEWLINE) .set(RE_NEWLINE_ALT) .set(RE_NO_BK_PARENS) .set(RE_NO_BK_VBAR) .makeFinal(); RE_SYNTAX_POSIX_EGREP = new RESyntax(RE_SYNTAX_EGREP) .set(RE_INTERVALS) .set(RE_NO_BK_BRACES) .makeFinal(); /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ RE_SYNTAX_ED = new RESyntax(RE_SYNTAX_POSIX_BASIC) .makeFinal(); RE_SYNTAX_SED = new RESyntax(RE_SYNTAX_POSIX_BASIC) .makeFinal(); RE_SYNTAX_POSIX_MINIMAL_BASIC = new RESyntax(RE_SYNTAX_POSIX_COMMON) .set(RE_LIMITED_OPS) .makeFinal(); /* Differs from RE_SYNTAX_POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ RE_SYNTAX_POSIX_MINIMAL_EXTENDED = new RESyntax(RE_SYNTAX_POSIX_COMMON) .set(RE_CONTEXT_INDEP_ANCHORS) .set(RE_CONTEXT_INVALID_OPS) .set(RE_NO_BK_BRACES) .set(RE_NO_BK_PARENS) .set(RE_NO_BK_REFS) .set(RE_NO_BK_VBAR) .set(RE_UNMATCHED_RIGHT_PAREN_ORD) .makeFinal(); /* There is no official Perl spec, but here's a "best guess" */ RE_SYNTAX_PERL4 = new RESyntax() .set(RE_BACKSLASH_ESCAPE_IN_LISTS) .set(RE_CONTEXT_INDEP_ANCHORS) .set(RE_CONTEXT_INDEP_OPS) // except for '{', apparently .set(RE_INTERVALS) .set(RE_NO_BK_BRACES) .set(RE_NO_BK_PARENS) .set(RE_NO_BK_VBAR) .set(RE_NO_EMPTY_RANGES) .set(RE_CHAR_CLASS_ESCAPES) // \d,\D,\w,\W,\s,\S .makeFinal(); RE_SYNTAX_PERL4_S = new RESyntax(RE_SYNTAX_PERL4) .set(RE_DOT_NEWLINE) .makeFinal(); RE_SYNTAX_PERL5 = new RESyntax(RE_SYNTAX_PERL4) .set(RE_PURE_GROUPING) // (?:) .set(RE_STINGY_OPS) // *?,??,+?,{}? .set(RE_LOOKAHEAD) // (?=)(?!) .set(RE_STRING_ANCHORS) // \A,\Z .set(RE_CHAR_CLASS_ESC_IN_LISTS)// \d,\D,\w,\W,\s,\S within [] .set(RE_COMMENTS) // (?#) .makeFinal(); RE_SYNTAX_PERL5_S = new RESyntax(RE_SYNTAX_PERL5) .set(RE_DOT_NEWLINE) .makeFinal(); } /** * Construct a new syntax object with all bits turned off. * This is equivalent to RE_SYNTAX_EMACS. */ public RESyntax() { bits = new BitSet(BIT_TOTAL); } /** * Called internally when constructing predefined syntaxes * so their interpretation cannot vary. Conceivably useful * for your syntaxes as well. Causes IllegalAccessError to * be thrown if any attempt to modify the syntax is made. * * @return this object for convenient chaining */ public RESyntax makeFinal() { isFinal = true; return this; } /** * Construct a new syntax object with all bits set the same * as the other syntax. */ public RESyntax(RESyntax other) { bits = (BitSet) other.bits.clone(); } /** * Check if a given bit is set in this syntax. */ public boolean get(int index) { return bits.get(index); } /** * Set a given bit in this syntax. * * @param index the constant (RESyntax.RE_xxx) bit to set. * @return a reference to this object for easy chaining. */ public RESyntax set(int index) { if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL); bits.set(index); return this; } /** * Clear a given bit in this syntax. * * @param index the constant (RESyntax.RE_xxx) bit to clear. * @return a reference to this object for easy chaining. */ public RESyntax clear(int index) { if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL); bits.clear(index); return this; } /** * Changes the line separator string for regular expressions * created using this RESyntax. The default separator is the * value returned by the system property "line.separator", which * should be correct when reading platform-specific files from a * filesystem. However, many programs may collect input from * sources where the line separator is differently specified (for * example, in the applet environment, the text box widget * interprets line breaks as single-character newlines, * regardless of the host platform. * * Note that setting the line separator to a character or * characters that have specific meaning within the current syntax * can cause unexpected chronosynclastic infundibula. * * @return this object for convenient chaining */ public RESyntax setLineSeparator(String aSeparator) { if (isFinal) throw new IllegalAccessError(SYNTAX_IS_FINAL); lineSeparator = aSeparator; return this; } /** * Returns the currently active line separator string. The default * is the platform-dependent system property "line.separator". */ public String getLineSeparator() { return lineSeparator; } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REToken.java0100644000175000000620000000352507364636622021416 0ustar killerstaff/* * gnu/regexp/REToken.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Serializable; abstract class REToken implements Serializable { protected REToken next = null; protected REToken uncle = null; protected int subIndex; protected REToken(int subIndex) { this.subIndex = subIndex; } int getMinimumLength() { return 0; } void setUncle(REToken anUncle) { uncle = anUncle; } /** Returns true if the match succeeded, false if it failed. */ abstract boolean match(CharIndexed input, REMatch mymatch); /** Returns true if the rest of the tokens match, false if they fail. */ protected boolean next(CharIndexed input, REMatch mymatch) { if (next == null) { if (uncle == null) { return true; } else { return uncle.match(input, mymatch); } } else { return next.match(input, mymatch); } } boolean chain(REToken token) { next = token; return true; // Token was accepted } abstract void dump(StringBuffer os); void dumpAll(StringBuffer os) { dump(os); if (next != null) next.dumpAll(os); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenAny.java0100644000175000000620000000307207313462717022057 0ustar killerstaff/* * gnu/regexp/RETokenAny.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; final class RETokenAny extends REToken { /** True if '.' can match a newline (RE_DOT_NEWLINE) */ private boolean newline; /** True if '.' can't match a null (RE_DOT_NOT_NULL) */ private boolean matchNull; RETokenAny(int subIndex, boolean newline, boolean matchNull) { super(subIndex); this.newline = newline; this.matchNull = matchNull; } int getMinimumLength() { return 1; } boolean match(CharIndexed input, REMatch mymatch) { char ch = input.charAt(mymatch.index); if ((ch == CharIndexed.OUT_OF_BOUNDS) || (!newline && (ch == '\n')) || (matchNull && (ch == 0))) { return false; } ++mymatch.index; return next(input, mymatch); } void dump(StringBuffer os) { os.append('.'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenBackRef.java0100644000175000000620000000302007265111126022605 0ustar killerstaff/* * gnu/regexp/RETokenBackRef.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; final class RETokenBackRef extends REToken { private int num; private boolean insens; RETokenBackRef(int subIndex, int num, boolean insens) { super(subIndex); this.num = num; this.insens = insens; } // should implement getMinimumLength() -- any ideas? boolean match(CharIndexed input, REMatch mymatch) { int b,e; b = mymatch.start[num]; e = mymatch.end[num]; if ((b==-1)||(e==-1)) return false; // this shouldn't happen, but... for (int i=b; i0) ? false : next(input, mymatch); if (newline != null) { char z; int i = 0; // position in newline do { z = newline.charAt(i); if (ch != z) return false; ++i; ch = input.charAt(mymatch.index + i); } while (i < newline.length()); return next(input, mymatch); } return false; } void dump(StringBuffer os) { os.append('$'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenEndSub.java0100644000175000000620000000215507265111126022500 0ustar killerstaff/* * gnu/regexp/RETokenEndSub.java * Copyright (C) 2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; final class RETokenEndSub extends REToken { RETokenEndSub(int subIndex) { super(subIndex); } boolean match(CharIndexed input, REMatch mymatch) { mymatch.end[subIndex] = mymatch.index; return next(input, mymatch); } void dump(StringBuffer os) { // handled by RE } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenLookAhead.java0100644000175000000620000000344307364636622023165 0ustar killerstaff/* * gnu/regexp/RETokenOneOf.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; /** * @since gnu.regexp 1.1.3 * @author Shashank Bapat */ final class RETokenLookAhead extends REToken { REToken re; boolean negative; RETokenLookAhead(REToken re, boolean negative) throws REException { super(0); this.re = re; this.negative = negative; } boolean match(CharIndexed input, REMatch mymatch) { REMatch trymatch = (REMatch)mymatch.clone(); REMatch trymatch1 = (REMatch)mymatch.clone(); REMatch newMatch = null; if (re.match(input, trymatch)) { if (negative) return false; if (next(input, trymatch1)) newMatch = trymatch1; } if (newMatch != null) { if (negative) return false; //else mymatch.assignFrom(newMatch); return true; } else { // no match if (negative) return next(input, mymatch); //else return false; } } void dump(StringBuffer os) { os.append("(?"); os.append(negative ? '!' : '='); re.dumpAll(os); os.append(')'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenWordBoundary.java0100644000175000000620000000524607265111126023743 0ustar killerstaff/* * gnu/regexp/RETokenWordBoundary.java * Copyright (C) 2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; /** * Represents a combination lookahead/lookbehind for POSIX [:alnum:]. */ final class RETokenWordBoundary extends REToken { private boolean negated; private int where; static final int BEGIN = 1; static final int END = 2; RETokenWordBoundary(int subIndex, int where, boolean negated) { super(subIndex); this.where = where; this.negated = negated; } boolean match(CharIndexed input, REMatch mymatch) { // Word boundary means input[index-1] was a word character // and input[index] is not, or input[index] is a word character // and input[index-1] was not // In the string "one two three", these positions match: // |o|n|e| |t|w|o| |t|h|r|e|e| // ^ ^ ^ ^ ^ ^ boolean after = false; // is current character a letter or digit? boolean before = false; // is previous character a letter or digit? char ch; // TODO: Also check REG_ANCHORINDEX vs. anchor if (((mymatch.eflags & RE.REG_ANCHORINDEX) != RE.REG_ANCHORINDEX) || (mymatch.offset + mymatch.index > mymatch.anchor)) { if ((ch = input.charAt(mymatch.index - 1)) != CharIndexed.OUT_OF_BOUNDS) { before = Character.isLetterOrDigit(ch) || (ch == '_'); } } if ((ch = input.charAt(mymatch.index)) != CharIndexed.OUT_OF_BOUNDS) { after = Character.isLetterOrDigit(ch) || (ch == '_'); } // if (before) and (!after), we're at end (\>) // if (after) and (!before), we're at beginning (\<) boolean doNext = false; if ((where & BEGIN) == BEGIN) { doNext = after && !before; } if ((where & END) == END) { doNext ^= before && !after; } if (negated) doNext = !doNext; return (doNext ? next(input, mymatch) : false); } void dump(StringBuffer os) { if (where == (BEGIN | END)) { os.append( negated ? "\\B" : "\\b" ); } else if (where == BEGIN) { os.append("\\<"); } else { os.append("\\>"); } } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenOneOf.java0100644000175000000620000000631107265111126022324 0ustar killerstaff/* * gnu/regexp/RETokenOneOf.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.util.Vector; final class RETokenOneOf extends REToken { private Vector options; private boolean negative; // This constructor is used for convenience when we know the set beforehand, // e.g. \d --> new RETokenOneOf("0123456789",false, ..) // \D --> new RETokenOneOf("0123456789",true, ..) RETokenOneOf(int subIndex, String optionsStr, boolean negative, boolean insens) { super(subIndex); options = new Vector(); this.negative = negative; for (int i = 0; i < optionsStr.length(); i++) options.addElement(new RETokenChar(subIndex,optionsStr.charAt(i),insens)); } RETokenOneOf(int subIndex, Vector options, boolean negative) { super(subIndex); this.options = options; this.negative = negative; } int getMinimumLength() { int min = Integer.MAX_VALUE; int x; for (int i=0; i < options.size(); i++) { if ((x = ((REToken) options.elementAt(i)).getMinimumLength()) < min) min = x; } return min; } boolean match(CharIndexed input, REMatch mymatch) { if (negative && (input.charAt(mymatch.index) == CharIndexed.OUT_OF_BOUNDS)) return false; REMatch newMatch = null; REMatch last = null; REToken tk; boolean isMatch; for (int i=0; i < options.size(); i++) { tk = (REToken) options.elementAt(i); REMatch tryMatch = (REMatch) mymatch.clone(); if (tk.match(input, tryMatch)) { // match was successful if (negative) return false; if (next(input, tryMatch)) { // Add tryMatch to list of possibilities. if (last == null) { newMatch = tryMatch; last = tryMatch; } else { last.next = tryMatch; last = tryMatch; } } // next succeeds } // is a match } // try next option if (newMatch != null) { if (negative) { return false; } else { // set contents of mymatch equal to newMatch // try each one that matched mymatch.assignFrom(newMatch); return true; } } else { if (negative) { ++mymatch.index; return next(input, mymatch); } else { return false; } } // index+1 works for [^abc] lists, not for generic lookahead (--> index) } void dump(StringBuffer os) { os.append(negative ? "[^" : "(?:"); for (int i = 0; i < options.size(); i++) { if (!negative && (i > 0)) os.append('|'); ((REToken) options.elementAt(i)).dumpAll(os); } os.append(negative ? ']' : ')'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenPOSIX.java0100644000175000000620000000675507265111126022234 0ustar killerstaff/* * gnu/regexp/RETokenPOSIX.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; final class RETokenPOSIX extends REToken { int type; boolean insens; boolean negated; static final int ALNUM = 0; static final int ALPHA = 1; static final int BLANK = 2; static final int CNTRL = 3; static final int DIGIT = 4; static final int GRAPH = 5; static final int LOWER = 6; static final int PRINT = 7; static final int PUNCT = 8; static final int SPACE = 9; static final int UPPER = 10; static final int XDIGIT = 11; // Array indices correspond to constants defined above. static final String[] s_nameTable = { "alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "xdigit" }; // The RE constructor uses this to look up the constant for a string static int intValue(String key) { for (int i = 0; i < s_nameTable.length; i++) { if (s_nameTable[i].equals(key)) return i; } return -1; } RETokenPOSIX(int subIndex, int type, boolean insens, boolean negated) { super(subIndex); this.type = type; this.insens = insens; this.negated = negated; } int getMinimumLength() { return 1; } boolean match(CharIndexed input, REMatch mymatch) { char ch = input.charAt(mymatch.index); if (ch == CharIndexed.OUT_OF_BOUNDS) return false; boolean retval = false; switch (type) { case ALNUM: // Note that there is some debate over whether '_' should be included retval = Character.isLetterOrDigit(ch) || (ch == '_'); break; case ALPHA: retval = Character.isLetter(ch); break; case BLANK: retval = ((ch == ' ') || (ch == '\t')); break; case CNTRL: retval = Character.isISOControl(ch); break; case DIGIT: retval = Character.isDigit(ch); break; case GRAPH: retval = (!(Character.isWhitespace(ch) || Character.isISOControl(ch))); break; case LOWER: retval = ((insens && Character.isLetter(ch)) || Character.isLowerCase(ch)); break; case PRINT: retval = (!(Character.isWhitespace(ch) || Character.isISOControl(ch))) || (ch == ' '); break; case PUNCT: // This feels sloppy, especially for non-U.S. locales. retval = ("`~!@#$%^&*()-_=+[]{}\\|;:'\"/?,.<>".indexOf(ch)!=-1); break; case SPACE: retval = Character.isWhitespace(ch); break; case UPPER: retval = ((insens && Character.isLetter(ch)) || Character.isUpperCase(ch)); break; case XDIGIT: retval = (Character.isDigit(ch) || ("abcdefABCDEF".indexOf(ch)!=-1)); break; } if (negated) retval = !retval; if (retval) { ++mymatch.index; return next(input, mymatch); } else return false; } void dump(StringBuffer os) { if (negated) os.append('^'); os.append("[:" + s_nameTable[type] + ":]"); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenRange.java0100644000175000000620000000303107265111126022346 0ustar killerstaff/* * gnu/regexp/RETokenRange.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; final class RETokenRange extends REToken { private char lo, hi; private boolean insens; RETokenRange(int subIndex, char lo, char hi, boolean ins) { super(subIndex); this.lo = (insens = ins) ? Character.toLowerCase(lo) : lo; this.hi = ins ? Character.toLowerCase(hi) : hi; } int getMinimumLength() { return 1; } boolean match(CharIndexed input, REMatch mymatch) { char c = input.charAt(mymatch.index); if (c == CharIndexed.OUT_OF_BOUNDS) return false; if (insens) c = Character.toLowerCase(c); if ((c >= lo) && (c <= hi)) { ++mymatch.index; return next(input, mymatch); } return false; } void dump(StringBuffer os) { os.append(lo).append('-').append(hi); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenRepeated.java0100644000175000000620000001365507313462717023071 0ustar killerstaff/* * gnu/regexp/RETokenRepeated.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.util.Vector; final class RETokenRepeated extends REToken { private REToken token; private int min,max; private boolean stingy; RETokenRepeated(int subIndex, REToken token, int min, int max) { super(subIndex); this.token = token; this.min = min; this.max = max; } /** Sets the minimal matching mode to true. */ void makeStingy() { stingy = true; } /** Queries if this token has minimal matching enabled. */ boolean isStingy() { return stingy; } /** * The minimum length of a repeated token is the minimum length * of the token multiplied by the minimum number of times it must * match. */ int getMinimumLength() { return (min * token.getMinimumLength()); } // We do need to save every possible point, but the number of clone() // invocations here is really a killer for performance on non-stingy // repeat operators. I'm open to suggestions... // Hypothetical question: can you have a RE that matches 1 times, // 3 times, 5 times, but not 2 times or 4 times? Does having // the subexpression back-reference operator allow that? boolean match(CharIndexed input, REMatch mymatch) { // number of times we've matched so far int numRepeats = 0; // Possible positions for the next repeat to match at REMatch newMatch = mymatch; REMatch last = null; REMatch current; // Add the '0-repeats' index // positions.elementAt(z) == position [] in input after <> matches Vector positions = new Vector(); positions.addElement(newMatch); // Declare variables used in loop REMatch doables; REMatch doablesLast; REMatch recurrent; do { // Check for stingy match for each possibility. if (stingy && (numRepeats >= min)) { REMatch result = matchRest(input, newMatch); if (result != null) { mymatch.assignFrom(result); return true; } } doables = null; doablesLast = null; // try next repeat at all possible positions for (current = newMatch; current != null; current = current.next) { recurrent = (REMatch) current.clone(); if (token.match(input, recurrent)) { // add all items in current to doables array if (doables == null) { doables = recurrent; doablesLast = recurrent; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) doablesLast.next = recurrent; } // Find new doablesLast while (doablesLast.next != null) { doablesLast = doablesLast.next; } } } // if none of the possibilities worked out, break out of do/while if (doables == null) break; // reassign where the next repeat can match newMatch = doables; // increment how many repeats we've successfully found ++numRepeats; positions.addElement(newMatch); } while (numRepeats < max); // If there aren't enough repeats, then fail if (numRepeats < min) return false; // We're greedy, but ease off until a true match is found int posIndex = positions.size(); // At this point we've either got too many or just the right amount. // See if this numRepeats works with the rest of the regexp. REMatch allResults = null; REMatch allResultsLast = null; REMatch results = null; while (--posIndex >= min) { newMatch = (REMatch) positions.elementAt(posIndex); results = matchRest(input, newMatch); if (results != null) { if (allResults == null) { allResults = results; allResultsLast = results; } else { // Order these from longest to shortest // Start by assuming longest (more repeats) allResultsLast.next = results; } // Find new doablesLast while (allResultsLast.next != null) { allResultsLast = allResultsLast.next; } } // else did not match rest of the tokens, try again on smaller sample } if (allResults != null) { mymatch.assignFrom(allResults); // does this get all? return true; } // If we fall out, no matches. return false; } private REMatch matchRest(CharIndexed input, final REMatch newMatch) { REMatch current, single; REMatch doneIndex = null; REMatch doneIndexLast = null; // Test all possible matches for this number of repeats for (current = newMatch; current != null; current = current.next) { // clone() separates a single match from the chain single = (REMatch) current.clone(); if (next(input, single)) { // chain results to doneIndex if (doneIndex == null) { doneIndex = single; doneIndexLast = single; } else { doneIndexLast.next = single; } // Find new doneIndexLast while (doneIndexLast.next != null) { doneIndexLast = doneIndexLast.next; } } } return doneIndex; } void dump(StringBuffer os) { os.append("(?:"); token.dumpAll(os); os.append(')'); if ((max == Integer.MAX_VALUE) && (min <= 1)) os.append( (min == 0) ? '*' : '+' ); else if ((min == 0) && (max == 1)) os.append('?'); else { os.append('{').append(min); if (max > min) { os.append(','); if (max != Integer.MAX_VALUE) os.append(max); } os.append('}'); } if (stingy) os.append('?'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/RETokenStart.java0100644000175000000620000000401307265111126022410 0ustar killerstaff/* * gnu/regexp/RETokenStart.java * Copyright (C) 1998-2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; class RETokenStart extends REToken { private String newline; // matches after a newline RETokenStart(int subIndex, String newline) { super(subIndex); this.newline = newline; } boolean match(CharIndexed input, REMatch mymatch) { // charAt(index-n) may be unknown on a Reader/InputStream. FIXME // Match after a newline if in multiline mode if (newline != null) { int len = newline.length(); if (mymatch.offset >= len) { boolean found = true; char z; int i = 0; // position in REToken.newline char ch = input.charAt(mymatch.index - len); do { z = newline.charAt(i); if (ch != z) { found = false; break; } ++i; ch = input.charAt(mymatch.index - len + i); } while (i < len); if (found) return next(input, mymatch); } } // Don't match at all if REG_NOTBOL is set. if ((mymatch.eflags & RE.REG_NOTBOL) > 0) return false; if ((mymatch.eflags & RE.REG_ANCHORINDEX) > 0) return (mymatch.anchor == mymatch.offset) ? next(input, mymatch) : false; else return ((mymatch.index == 0) && (mymatch.offset == 0)) ? next(input, mymatch) : false; } void dump(StringBuffer os) { os.append('^'); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/UncheckedRE.java0100644000175000000620000000726107356712162022223 0ustar killerstaff/* * gnu/regexp/UncheckedRE.java * Copyright (C) 2001 Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; /** * UncheckedRE is a subclass of RE that allows programmers an easier means * of programmatically precompiling regular expressions. It is constructed * and used in exactly the same manner as an instance of the RE class; the * only difference is that its constructors do not throw REException. * Instead, if a syntax error is encountered during construction, a * RuntimeException will be thrown. *

    * Note that this makes UncheckedRE dangerous if constructed with * dynamic data. Do not use UncheckedRE unless you are completely sure * that all input being passed to it contains valid, well-formed * regular expressions for the syntax specified. * * @author Wes Biggs * @see gnu.regexp.RE * @since gnu.regexp 1.1.4 */ public final class UncheckedRE extends RE { /** * Constructs a regular expression pattern buffer without any compilation * flags set, and using the default syntax (RESyntax.RE_SYNTAX_PERL5). * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer or char[]. Other input types will be converted to * strings using the toString() method. * @exception RuntimeException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public UncheckedRE(Object pattern) { this(pattern,0,RESyntax.RE_SYNTAX_PERL5); } /** * Constructs a regular expression pattern buffer using the specified * compilation flags and the default syntax (RESyntax.RE_SYNTAX_PERL5). * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer, or char[]. Other input types will be converted to * strings using the toString() method. * @param cflags The logical OR of any combination of the compilation flags in the RE class. * @exception RuntimeException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public UncheckedRE(Object pattern, int cflags) { this(pattern,cflags,RESyntax.RE_SYNTAX_PERL5); } /** * Constructs a regular expression pattern buffer using the specified * compilation flags and regular expression syntax. * * @param pattern A regular expression pattern, in the form of a String, * StringBuffer, or char[]. Other input types will be converted to * strings using the toString() method. * @param cflags The logical OR of any combination of the compilation flags in the RE class. * @param syntax The type of regular expression syntax to use. * @exception RuntimeException The input pattern could not be parsed. * @exception NullPointerException The pattern was null. */ public UncheckedRE(Object pattern, int cflags, RESyntax syntax) { try { initialize(pattern,cflags,syntax,0,0); } catch (REException e) { throw new RuntimeException(e.getMessage()); } } } libgnu-regexp-java-1.1.4/src/gnu/regexp/MessagesBundle.properties0100644000175000000620000000160007275454636024257 0ustar killerstaff# Localized error messages for gnu.regexp # Prefix for REException messages error.prefix=At position {0} in regular expression pattern: # REException (parse error) messages repeat.assertion=repeated token is zero-width assertion repeat.chained=attempted to repeat a token that is already repeated repeat.no.token=quantifier (?*+{}) without preceding token repeat.empty.token=repeated token may be empty unmatched.brace=unmatched brace unmatched.bracket=unmatched bracket unmatched.paren=unmatched parenthesis interval.no.end=expected end of interval class.no.end=expected end of character class subexpr.no.end=expected end of subexpression interval.order=interval minimum is greater than maximum interval.error=interval is empty or contains illegal chracters ends.with.backslash=backslash at end of pattern # RESyntax message syntax.final=Syntax has been declared final and cannot be modified libgnu-regexp-java-1.1.4/src/gnu/regexp/util/0042755000175000000620000000000007617541044020213 5ustar killerstafflibgnu-regexp-java-1.1.4/src/gnu/regexp/util/Egrep.java0100644000175000000620000000267706670624076022134 0ustar killerstaff/* * gnu/regexp/util/Egrep.java * Copyright (C) 1998 Wes Biggs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp.util; import gnu.regexp.RESyntax; /** * This is a front end to the gnu.regexp.util.Grep class which sets the * syntax used to RE_SYNTAX_EGREP, which aims to emulate the standard UNIX * egrep command. * * @author Wes Biggs * @version 1.01 * @use gnu.getopt */ public class Egrep { private Egrep() { } /** * Invokes Grep.grep() using the RE_SYNTAX_EGREP syntax and the * command line arguments specified. Output is sent to System.out. * For a list of options, use the argument "--help". */ public static void main(String[] argv) { System.exit(Grep.grep(argv,RESyntax.RE_SYNTAX_EGREP,System.out)); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/util/Grep.java0100644000175000000620000002623607364636622021765 0ustar killerstaff/* * gnu/regexp/util/Grep.java * Copyright (C) 1998 Wes Biggs * Copyright (C) 2001 Lee Sau Dan for the use of Reader for handling file I/O * Copyright (C) 2001 Ulf Dittmer for support of grepping into ZIP files * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp.util; import gnu.getopt.Getopt; import gnu.getopt.LongOpt; import gnu.regexp.RE; import gnu.regexp.REException; import gnu.regexp.REMatch; import gnu.regexp.RESyntax; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.util.Enumeration; import java.util.Vector; import java.util.zip.*; /** * Grep is a pure-Java clone of the GNU grep utility. As such, it is much * slower and not as full-featured, but it has the advantage of being * available on any system with a Java virtual machine. * * @author Wes Biggs * Lee Sau Dan * Ulf Dittmer * @version 1.03 * @use gnu.getopt */ public class Grep { private static final int BYTE_OFFSET = 0; private static final int COUNT = 1; private static final int LINE_NUMBER = 2; private static final int QUIET = 3; private static final int SILENT = 4; private static final int NO_FILENAME = 5; private static final int REVERT_MATCH = 6; private static final int FILES_WITH_MATCHES = 7; private static final int LINE_REGEXP = 8; private static final int FILES_WITHOUT_MATCH = 9; private static final int EXPAND_ZIP_FILES = 10; private static final String PROGNAME = "gnu.regexp.util.Grep"; private static final String PROGVERSION = "1.03"; private Grep() { } /** * Invokes the grep() function below with the command line arguments * and using the RESyntax.RE_SYNTAX_GREP syntax, which attempts to * emulate the traditional UNIX grep syntax. */ public static void main(String[] argv) { System.exit(grep(argv, RESyntax.RE_SYNTAX_GREP, System.out)); } /** * Runs Grep with the specified arguments. For a list of * supported options, specify "--help". * * This is the meat of the grep routine, but unlike main(), you can * specify your own syntax and PrintStream to use for output. */ public static int grep(String[] argv, RESyntax syntax, PrintStream out) { // use gnu.getopt to read arguments int cflags = 0; boolean[] options = new boolean [10]; String encoding = null; LongOpt[] longOptions = { new LongOpt("byte-offset", LongOpt.NO_ARGUMENT, null, 'b'), new LongOpt("count", LongOpt.NO_ARGUMENT, null, 'c'), new LongOpt("no-filename", LongOpt.NO_ARGUMENT, null, 'h'), new LongOpt("ignore-case", LongOpt.NO_ARGUMENT, null, 'i'), new LongOpt("files-with-matches", LongOpt.NO_ARGUMENT, null, 'l'), new LongOpt("help", LongOpt.NO_ARGUMENT, null, '!'), new LongOpt("line-number", LongOpt.NO_ARGUMENT, null, 'n'), new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'), new LongOpt("silent", LongOpt.NO_ARGUMENT, null, 'q'), new LongOpt("no-messages", LongOpt.NO_ARGUMENT, null, 's'), new LongOpt("revert-match", LongOpt.NO_ARGUMENT, null, 'v'), new LongOpt("line-regexp", LongOpt.NO_ARGUMENT, null, 'x'), new LongOpt("extended-regexp", LongOpt.NO_ARGUMENT, null, 'E'), new LongOpt("fixed-strings", LongOpt.NO_ARGUMENT, null, 'F'), // TODO new LongOpt("basic-regexp", LongOpt.NO_ARGUMENT, null, 'G'), new LongOpt("files-without-match", LongOpt.NO_ARGUMENT, null, 'L'), new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V'), new LongOpt("zip", LongOpt.NO_ARGUMENT, null, 'z'), new LongOpt("encoding", LongOpt.REQUIRED_ARGUMENT, null, 'N') }; Getopt g = new Getopt(PROGNAME, argv, "bchilnqsvxyEFGLVzN:", longOptions); int c; String arg; while ((c = g.getopt()) != -1) { switch (c) { case 'b': options[BYTE_OFFSET] = true; break; case 'c': options[COUNT] = true; break; case 'h': options[NO_FILENAME] = true; break; case 'i': case 'y': cflags |= RE.REG_ICASE; break; case 'l': options[FILES_WITH_MATCHES] = true; break; case 'n': options[LINE_NUMBER] = true; break; case 'q': options[QUIET] = true; break; case 's': options[SILENT] = true; break; case 'v': options[REVERT_MATCH] = true; break; case 'x': options[LINE_REGEXP] = true; break; case 'E': // TODO: check compatibility with grep syntax = RESyntax.RE_SYNTAX_EGREP; break; case 'F': // TODO: fixed strings break; case 'G': syntax = RESyntax.RE_SYNTAX_GREP; break; case 'L': options[FILES_WITHOUT_MATCH] = true; break; case 'V': System.err.println(PROGNAME+' '+PROGVERSION); return 0; case 'z': options[EXPAND_ZIP_FILES] = true; break; case 'N': encoding = g.getOptarg(); try { // try out this encoding now. If not found, fall back to default "".getBytes(encoding); } catch (UnsupportedEncodingException uee) { System.err.println(PROGNAME+": (Warning)" + " Unsupported Encoding: " + encoding + "; reverting to default"); encoding = null; } break; case '!': // help try { BufferedReader br = new BufferedReader(new InputStreamReader((Grep.class).getResourceAsStream("GrepUsage.txt"),"UTF8")); String line; while ((line = br.readLine()) != null) out.println(line); } catch (IOException ie) { } return 0; } } InputStream is = null; RE pattern = null; if (g.getOptind() >= argv.length) { System.err.println("Usage: java " + PROGNAME + " [OPTION]... PATTERN [FILE]..."); System.err.println("Try `java " + PROGNAME + " --help' for more information."); return 2; } try { pattern = new RE(argv[g.getOptind()],cflags,syntax); } catch (REException e) { System.err.println("Error in expression: "+e); return 2; } boolean notFound = true; if (argv.length >= g.getOptind()+2) { for (int i = g.getOptind() + 1; i < argv.length; i++) { boolean no_filename = (argv.length == g.getOptind()+2) || options[NO_FILENAME]; if (argv[i].equals("-")) { final String filename = no_filename ? null : "(standard input)"; if (processStream(pattern,System.in,encoding,options,filename,null,out)) notFound = false; } else { final String filename = no_filename ? null : argv[i]; try { File file = new File(argv[i]); if(file.isDirectory()) { System.err.println(PROGNAME + ": " + argv[i] + ": Is a directory"); } else if(!file.canRead()) { System.err.println(PROGNAME + ": " + argv[i] + ": Permission denied"); } else if (options[EXPAND_ZIP_FILES] && argv[i].endsWith(".zip")) { // iterate over all files within this ZIP file try { ZipFile zf = new ZipFile(file); Enumeration list = zf.entries(); while (list.hasMoreElements()) { ZipEntry ze = (ZipEntry) list.nextElement(); if (! ze.isDirectory()) { if (processStream(pattern, zf.getInputStream(ze), encoding, options, filename, ze.getName(), out)) notFound = false; } } } catch (Exception ex) { System.err.println(PROGNAME + ": " + argv[i] + ": Problem reading ZIP file"); return 2; } } else { if (processStream(pattern, new FileInputStream(argv[i]), encoding, options, filename, null, out)) notFound = false; } } catch (FileNotFoundException e) { if (!options[SILENT]) System.err.println(PROGNAME+": "+e); } } } } else { if (processStream(pattern,System.in,encoding,options,null,null,out)) notFound = false; } return notFound ? 1 : 0; } private static boolean processStream(RE pattern, InputStream is, String encoding, boolean[] options, String filename, String zipName, PrintStream out) { try { final InputStreamReader isr = encoding == null? new InputStreamReader(is) : new InputStreamReader(is,encoding); final BufferedReader r = new BufferedReader(isr); return processReader(pattern, r, options, filename, zipName, out); } catch (UnsupportedEncodingException uee) { /* since grep() should have checked that the 'encoding' parameter is valid, it should be impossible that this exception would happen. Of, sso, it is a logic error. */ throw new Error(PROGNAME + ": programming logic error"); } } private static String fileNameString (String fileName, String zipName) { if (zipName == null) return fileName; else return zipName + " in " + fileName; } private static boolean processReader(RE pattern, BufferedReader br, boolean[] options, String filename, String zipName, PrintStream out) { int newlineLen = System.getProperty("line.separator").length(); int count = 0; long atByte = 0; int atLine = 1; String line; REMatch match; try { while ((line = br.readLine()) != null) { match = pattern.getMatch(line); if (((options[LINE_REGEXP] && pattern.isMatch(line)) || (!options[LINE_REGEXP] && (match != null))) ^ options[REVERT_MATCH]) { count++; if (!options[COUNT]) { if (options[QUIET]) { return true; } if (options[FILES_WITH_MATCHES]) { if (filename != null) out.println(fileNameString(filename, zipName)); return true; } if (options[FILES_WITHOUT_MATCH]) { return false; } if (filename != null) { out.print(fileNameString(filename, zipName)); out.print(':'); } if (options[LINE_NUMBER]) { out.print(atLine); out.print(':'); } if (options[BYTE_OFFSET]) { out.print(atByte + match.getStartIndex() ); out.print(':'); } out.println(line); } } // a match atByte += line.length() + newlineLen; // could be troublesome... atLine++; } // a valid line br.close(); if (options[COUNT]) { if (filename != null) out.println(fileNameString(filename, zipName)+':'); out.println(count); } if (options[FILES_WITHOUT_MATCH] && count==0) { if (filename != null) out.println(fileNameString(filename, zipName)); } } catch (IOException e) { System.err.println(PROGNAME+": "+e); } return ((count > 0) ^ options[REVERT_MATCH]); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/util/GrepUsage.txt0100644000175000000620000000444307364636622022644 0ustar killerstaffUsage: java gnu.regexp.util.Grep [OPTION]... PATTERN [FILE] ... Search for PATTERN in each FILE or standard input. Most options same as GNU grep. Regexp selection and interpretation: -E, --extended-regexp PATTERN is an extended regular expression -G, --basic-regexp PATTERN is a basic regular expression -i, --ignore-case ignore case distinctions Unsupported (may be available in a future release): -e, --regexp=PATTERN use PATTERN as a regular expression -f, --file=FILE obtain PATTERN from FILE -F, --fixed-regexp PATTERN is a fixed string separated by newlines -w, --word-regexp force PATTERN to match only whole words -x, --line-regexp force PATTERN to match only whole lines Miscellaneous: -s, --no-messages suppress error messages -v, --revert-match select non-matching lines -N, --encoding use the specified file encoding -z, --zip expand ZIP files -V, --version print version information and exit --help display this help and exit Output control: -b, --byte-offset print the byte offset with output lines -n, --line-number print line number with output lines -h, --no-filename suppress the prefixing filename on output -q, --quiet, --silent suppress all normal output -L, --files-without-match only print FILE names containing no match -l, --files-with-matches only print FILE names containing matches -c, --count only print a count of matching lines per FILE Unsupported (may be available in a future release): -H, --with-filename print the filename for each match Context control: Unsupported (may be available in a future release): -B, --before-context=NUM print NUM lines of leading context -A, --after-context=NUM print NUM lines of trailing context -NUM same as both -B NUM and -A NUM -C, --context same as -2 -U, --binary do not strip CR characters at EOL (MSDOS) -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS) With no FILE, or when FILE is -, read standard input. If less than two FILEs given, assume -h. Exit with 0 if matches, with 1 if none. Exit with 2 if syntax errors or system errors. Report bugs to . libgnu-regexp-java-1.1.4/src/gnu/regexp/util/REApplet.java0100644000175000000620000001464307237575340022541 0ustar killerstaff/* * gnu/regexp/util/REApplet.java * Copyright (C) 1998 Wes Biggs * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp.util; import java.applet.*; import java.awt.*; import gnu.regexp.*; /** * This is a simple applet to demonstrate the capabilities of gnu.regexp. * To run it, use appletviewer on the reapplet.html file included in the * documentation directory. * * @author Wes Biggs * @version 1.02 */ public class REApplet extends Applet { private Label l1, l2, l3, l4; private Button b; private TextField tf; private TextArea input, output; private Checkbox insens; private Choice syntax; private static String[] names = new String[] { "awk", "ed", "egrep", "emacs", "grep", "POSIX awk", "POSIX basic", "POSIX egrep", "POSIX extended", "POSIX minimal basic", "POSIX minimal extended", "sed", "perl 4", "perl 4 (singe line)", "perl 5", "perl 5 (single line)" }; private static RESyntax[] values = new RESyntax[] { new RESyntax(RESyntax.RE_SYNTAX_AWK).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_ED).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_EGREP).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_EMACS).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_GREP).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_AWK).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_BASIC).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_EGREP).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_EXTENDED).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_MINIMAL_BASIC).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_POSIX_MINIMAL_EXTENDED).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_SED).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_PERL4).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_PERL4_S).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_PERL5).setLineSeparator("\n"), new RESyntax(RESyntax.RE_SYNTAX_PERL5_S).setLineSeparator("\n") }; /** Creates an REApplet. */ public REApplet() { super(); } /** Initializes the applet and constructs GUI elements. */ public void init() { // test run RE stuff to cache gnu.regexp.* classes. try { RE x = new RE("^.*(w[x])\1$"); REMatchEnumeration xx = x.getMatchEnumeration("wxwx"); while (xx.hasMoreMatches()) xx.nextMatch().toString(); } catch (REException arg) { } setBackground(Color.lightGray); /* Layout looks like this: [0,0:[0,0: Regular Expression] [1,0: Textbox] [0,1: Expression Syntax] [1,1: [0,0: Choice] [1,0: Checkbox]] [1,2: Button]] [0,1: Input Text] [1,1: Match] [0,2: Textarea] [1,2: Textarea] */ GridBagLayout gbag = new GridBagLayout(); setLayout(gbag); GridBagConstraints c = new GridBagConstraints(); Panel p = new Panel(); GridBagLayout gbag2 = new GridBagLayout(); p.setLayout(gbag2); c.anchor = GridBagConstraints.WEST; c.weightx = 1.0; // [0,0: Regular Expression] c.gridx = 0; c.gridy = 0; l1 = new Label("Regular Expression"); gbag2.setConstraints(l1,c); p.add(l1); // [1,0: TextField] c.gridx = 1; tf = new TextField(getParameter("regexp"),30); gbag2.setConstraints(tf,c); p.add(tf); // [0,1: Expression Syntax] c.gridx = 0; c.gridy = 1; l4 = new Label("Expression Syntax"); gbag2.setConstraints(l4,c); p.add(l4); // [1,1: subpanel] Panel p2 = new Panel(); GridBagLayout gbag3 = new GridBagLayout(); p2.setLayout(gbag3); c.gridx = 1; gbag2.setConstraints(p2,c); p.add(p2); // Subpanel [0,0: Choice] c.gridx = 0; c.gridy = 0; syntax = new Choice(); for (int i = 0; i < names.length; i++) syntax.addItem(names[i]); String zz = getParameter("syntax"); if (zz != null) { try { syntax.select(getParameter("syntax")); } catch (IllegalArgumentException e) { } } gbag3.setConstraints(syntax,c); p2.add(syntax); c.gridx = 1; insens = new Checkbox("Ignore case",false); gbag3.setConstraints(insens,c); p2.add(insens); // Next Row c.gridx = 1; c.gridy = 2; b = new Button("Match"); gbag2.setConstraints(b,c); p.add(b); // Add the entire upper panel. c.gridwidth = 2; c.gridheight = 1; c.gridx = 0; c.gridy = 0; c.anchor = GridBagConstraints.CENTER; gbag.setConstraints(p,c); add(p); c.gridwidth = 1; c.gridheight = 1; // Main: [0,1]: l2 = new Label("Input Text"); c.gridwidth = 1; c.gridx = 0; c.gridy = 1; gbag.setConstraints(l2,c); add(l2); l3 = new Label("Matches Found"); c.gridx = 1; gbag.setConstraints(l3,c); add(l3); input = new TextArea(getParameter("input"),5,30); c.gridx = 0; c.gridy = 2; gbag.setConstraints(input,c); add(input); c.gridx = 1; output = new TextArea(5,30); output.setEditable(false); c.gridwidth = GridBagConstraints.REMAINDER; gbag.setConstraints(output,c); add(output); } /** * Handles events in the applet. Returns true if the indicated event * was handled, false for all other events. */ public boolean action(Event e, Object arg) { Object target = e.target; if (target == b) { // match try { String expr = tf.getText(); RE reg = null; RESyntax res = values[syntax.getSelectedIndex()]; reg = new RE(expr,insens.getState() ? RE.REG_ICASE | RE.REG_MULTILINE : RE.REG_MULTILINE, res); REMatchEnumeration en = reg.getMatchEnumeration(input.getText()); StringBuffer sb = new StringBuffer(); int matchNum = 0; while (en.hasMoreMatches()) { sb.append(String.valueOf(++matchNum)); sb.append(". "); sb.append(en.nextMatch().toString()); sb.append('\n'); } output.setText(sb.toString()); } catch (REException err) { output.setText("Expression compilation error: " + err.getMessage()); } return true; } else return false; } } libgnu-regexp-java-1.1.4/src/gnu/regexp/util/RETest.java0100644000175000000620000001130307265111126022206 0ustar killerstaff/* * gnu/regexp/util/RETest.java * Copyright (C) 1998-2001 Wes Biggs * * This file is in the public domain. However, the gnu.regexp library * proper is licensed under the terms of the GNU Lesser General Public * License (see the file COPYING.LIB for details). */ package gnu.regexp.util; import gnu.regexp.*; /** * RETest provides a simple way to test regular expressions. * It runs from the command line using the Java interpreter. * To use it, enter the following from a command prompt (provided * that the Java system knows where to find the RETest bytecodes): *
    java gnu.regexp.util.RETest [regExp] [inputString]
    * where regExp is a regular expression (you'll probably have * to escape shell meta-characters) and inputString is the string * to match against (again, put it in quotes or escape any shell meta- * characters). *

    * The test function will report the package version number, whether * the expression matches the input string, what the match it found was, * and the contents of any subexpressions, if applicable. *

    * You may optionally add a third integer argument which is the number of * times to repeat the test. When this option is used, RETest will report * average compile and match times. * * @author Wes Biggs * @version 1.01 */ public class RETest { private RETest() { } /** * Invokes the test function with the command line arguments specified. * See class description for usage notes. * * @param argv * The command line arguments. * * @exception REException * There was an error compiling or executing the regular expression. */ public static void main(String argv[]) throws REException { System.out.println("gnu.regexp version "+RE.version()); int numRepeats = 1; if (argv.length == 3) numRepeats = Integer.parseInt(argv[2]); if (argv.length < 2) { System.out.println("usage: java gnu.regexp.util.RETest regExp inputString [numRepeats]"); System.exit(1); } // Construct the regular expression RE expression = null; long begin = System.currentTimeMillis(); for (int rpt = 0; rpt < numRepeats; rpt++) expression = new RE(argv[0]); long end = System.currentTimeMillis(); if (numRepeats>1) { System.out.println("Compiling "+numRepeats+" times took "+(end-begin)+" ms"); System.out.println("Average compile time: "+((end-begin)/numRepeats)+" ms"); } // Display regular expression System.out.println(" Input Text: "+argv[1]); System.out.println("Regular Expression: "+argv[0]); System.out.println(" Compiled Form: "+expression); System.out.println(" Minimum Length: "+expression.getMinimumLength()); // Is the input in its entirety a match? System.out.println(" isMatch() returns: "+expression.isMatch(argv[1])); REMatch[] matches = expression.getAllMatches(argv[1]); System.out.println(" getAllMatches(): " + matches.length + " matches"); for (int i = 0; i < matches.length; i++) { System.out.println("Match " + i + " (" + matches[i].getStartIndex() + "," + matches[i].getEndIndex() + "): " + matches[i]); } // Get the first match REMatch match = null; begin = System.currentTimeMillis(); for (int rpt = 0; rpt < numRepeats; rpt++) match = expression.getMatch(argv[1]); end = System.currentTimeMillis(); if (numRepeats>1) { System.out.println("Finding first match "+numRepeats+" times took "+(end-begin)+" ms"); System.out.println("Average match time: "+((end-begin)/numRepeats)+" ms"); } if (match == null) System.out.println("Expression did not find a match."); else { // Report the full match indices System.out.println("Match found from position " + match.getStartIndex() + " to position " + match.getEndIndex()); // Take advantage of REMatch.toString() to print match text System.out.println("Match was: '" + match + "'"); // Report subexpression positions for (int i=1; i <= expression.getNumSubs(); i++) { if (match.getStartIndex(i) > -1) { System.out.println("Subexpression #" + i + ": from position " + match.getStartIndex(i) + " to position " + match.getEndIndex(i)); // Note how the $n is constructed for substituteInto System.out.println(match.substituteInto("The subexpression matched this text: '$"+i+"'")); } } } // Here's a substitute test. System.out.println("substitute(): " + expression.substitute(argv[1],"")); System.out.println("substituteAll(): " + expression.substituteAll(argv[1],"")); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/util/Tests.java0100644000175000000620000000752507313462717022166 0ustar killerstaff/* * gnu/regexp/util/Tests.java -- Simple testsuite for gnu.regexp package * Copyright (C) 1998-2001 Wes Biggs * * This file is in the public domain. However, the gnu.regexp library * proper is licensed under the terms of the GNU Lesser General Public * License (see the file COPYING.LIB for details). */ package gnu.regexp.util; import gnu.regexp.*; import java.io.StringBufferInputStream; import java.io.StringReader; /** * This is a very basic testsuite application for gnu.regexp. * * @author Wes Biggs * @version 1.1.1 */ public class Tests { private Tests() { } private static void check(RE expr, String input, String expect, int id) { // Test it using all possible input types check(expr.getMatch(input),expect,id, "String"); check(expr.getMatch(new StringBuffer(input)),expect,id, "StringBuffer"); check(expr.getMatch(input.toCharArray()),expect,id, "char[]"); check(expr.getMatch(new StringReader(input)),expect,id, "Reader"); check(expr.getMatch(new StringBufferInputStream(input)),expect,id, "InputStream"); } private static void check(REMatch m, String expect, int x, String type) { if ((m == null) || !m.toString().equals(expect)) System.out.print("*** Failed"); else System.out.print("Passed"); System.out.println(" test #"+x + " (" + type + ")"); } /** * Runs the testsuite. No command line arguments are necessary. * * @exception REException An error occurred compiling a regular expression. */ public static void main(String[] argv) throws REException { RE e; e = new RE("(.*)z"); check(e,("xxz"),"xxz",1); e = new RE(".*z"); check(e,("xxz"),"xxz",2); e = new RE("(x|xy)z"); check(e,("xz"),"xz",3); check(e,("xyz"),"xyz",4); e = new RE("(x)+z"); check(e,("xxz"),"xxz",5); e = new RE("abc"); check(e,("xyzabcdef"),"abc",6); e = new RE("^start.*end$"); check(e,("start here and go to the end"),"start here and go to the end",7); e = new RE("(x|xy)+z"); check(e,("xxyz"),"xxyz",8); e = new RE("type=([^ \t]+)[ \t]+exts=([^ \t\n\r]+)"); check(e,("type=text/html exts=htm,html"),"type=text/html exts=htm,html",9); e = new RE("(x)\\1"); check(e,("zxxz"),"xx", 10); e = new RE("(x*)(y)\\2\\1"); check(e,("xxxyyxx"),"xxyyxx",11); e = new RE("[-go]+"); check(e,("go-go"),"go-go",12); e = new RE("[\\w-]+"); check(e,("go-go"),"go-go",13); e = new RE("^start.*?end"); check(e,("start here and end in the middle, not the very end"),"start here and end",14); e = new RE("\\d\\s\\w\\n\\r"); check(e,(" 9\tX\n\r "),"9\tX\n\r",15); e = new RE("zow",RE.REG_ICASE); check(e,("ZoW"),"ZoW",16); e = new RE("(\\d+)\\D*(\\d+)\\D*(\\d)+"); check(e,("size--10 by 20 by 30 feet"),"10 by 20 by 30",17); e = new RE("(ab)(.*?)(d)"); REMatch m = e.getMatch("abcd"); check(m,"abcd",18, "String"); System.out.println(((m.toString(2).equals("c")) ? "Pass" : "*** Fail") + "ed test #19"); e = new RE("^$"); check(e,(""),"",20); e = new RE("a*"); check(e,(""),"",21); check(e,("a"),"a",22); check(e,("aa"),"aa",23); e = new RE("(([12]))?"); check(e,("12"),"1",24); e = new RE("(.*)?b"); check(e,("ab"),"ab",25); e = new RE("(.*)?-(.*)"); check(e,("a-b"), "a-b", 26); e = new RE("(a)b"); check(e,("aab"), "ab", 27); e = new RE("[M]iss"); check(e,("one Mississippi"), "Miss", 28); e = new RE("\\S Miss"); check(e,("one Mississippi"), "e Miss", 29); e = new RE("a*"); check(e,("b"),"",30); check(e,("ab"),"a",31); check(e,("aab"),"aa",32); // Single character should match anywhere in String e = new RE("a"); check(e,("a"),"a", 33); check(e,("ab"),"a", 34); check(e,("ba"),"a", 35); check(e,("bab"),"a", 36); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/CharIndexedReader.java0100644000175000000620000000715207265111125023372 0ustar killerstaff/* * gnu/regexp/CharIndexedReader.java * Copyright (C) 2001 Lee Sau Dan * Based on gnu.regexp.CharIndexedInputStream by Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.Reader; import java.io.BufferedReader; import java.io.IOException; // TODO: move(x) shouldn't rely on calling next() x times class CharIndexedReader implements CharIndexed { private static final int BUFFER_INCREMENT = 1024; private static final int UNKNOWN = Integer.MAX_VALUE; // value for end private final BufferedReader br; // so that we don't try to reset() right away private int index = -1; private int bufsize = BUFFER_INCREMENT; private int end = UNKNOWN; private char cached = OUT_OF_BOUNDS; // Big enough for a \r\n pair // lookBehind[0] = most recent // lookBehind[1] = second most recent private char[] lookBehind = new char[] { OUT_OF_BOUNDS, OUT_OF_BOUNDS }; CharIndexedReader(Reader reader, int index) { if (reader instanceof BufferedReader) { br = (BufferedReader) reader; } else { br = new BufferedReader(reader,BUFFER_INCREMENT); } next(); if (index > 0) move(index); } private boolean next() { lookBehind[1] = lookBehind[0]; lookBehind[0] = cached; if (end == 1) { cached = OUT_OF_BOUNDS; return false; } end--; // closer to end try { if (index != -1) { br.reset(); } int i = br.read(); br.mark(bufsize); if (i == -1) { end = 1; cached = OUT_OF_BOUNDS; return false; } // convert the byte read into a char cached = (char) i; index = 1; } catch (IOException e) { e.printStackTrace(); cached = OUT_OF_BOUNDS; return false; } return true; } public char charAt(int index) { if (index == 0) { return cached; } else if (index >= end) { return OUT_OF_BOUNDS; } else if (index >= bufsize) { // Allocate more space in the buffer. try { while (bufsize <= index) bufsize += BUFFER_INCREMENT; br.reset(); br.mark(bufsize); br.skip(index-1); } catch (IOException e) { } } else if (this.index != index) { try { br.reset(); br.skip(index-1); } catch (IOException e) { } } else if (index == -1) { return lookBehind[0]; } else if (index == -2) { return lookBehind[1]; } else if (index < -2) { return OUT_OF_BOUNDS; } char ch = OUT_OF_BOUNDS; try { int i = br.read(); this.index = index+1; // this.index is index of next pos relative to charAt(0) if (i == -1) { // set flag that next should fail next time? end = index; return ch; } ch = (char) i; } catch (IOException ie) { } return ch; } public boolean move(int index) { // move read position [index] clicks from 'charAt(0)' boolean retval = true; while (retval && (index-- > 0)) retval = next(); return retval; } public boolean isValid() { return (cached != OUT_OF_BOUNDS); } } libgnu-regexp-java-1.1.4/src/gnu/regexp/REFilterReader.java0100644000175000000620000000665607265423016022705 0ustar killerstaff/* * gnu/regexp/REFilterReader.java * Copyright (C) 2001 Lee Sau Dan * Based on gnu.regexp.REFilterInputStream by Wes Biggs * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package gnu.regexp; import java.io.FilterReader; import java.io.Reader; /** * Replaces instances of a given RE with replacement text. * * @author Lee Sau Dan * @since gnu.regexp 1.1.0 */ public class REFilterReader extends FilterReader { private RE expr; private String replace; private String buffer; private int bufpos; private int offset; private CharIndexedReader stream; /** * Creates an REFilterReader. When reading from this stream, * occurrences of patterns matching the supplied regular expression * will be replaced with the supplied replacement text (the * metacharacters $0 through $9 may be used to refer to the full * match or subexpression matches. * * @param stream The Reader to be filtered. * @param expr The regular expression to search for. * @param replace The text pattern to replace matches with. */ public REFilterReader(Reader stream, RE expr, String replace) { super(stream); this.stream = new CharIndexedReader(stream,0); this.expr = expr; this.replace = replace; } /** * Reads the next character from the stream per the general contract of * Reader.read(). Returns -1 on error or end of stream. */ public int read() { // If we have buffered replace data, use it. if ((buffer != null) && (bufpos < buffer.length())) { return (int) buffer.charAt(bufpos++); } // check if input is at a valid position if (!stream.isValid()) return -1; REMatch mymatch = new REMatch(expr.getNumSubs(),offset,0); if (expr.match(stream,mymatch)) { mymatch.end[0] = mymatch.index; mymatch.finish(stream); stream.move(mymatch.toString().length()); offset += mymatch.toString().length(); buffer = mymatch.substituteInto(replace); bufpos = 1; if (buffer.length() > 0) { return buffer.charAt(0); } } char ch = stream.charAt(0); if (ch == CharIndexed.OUT_OF_BOUNDS) return -1; stream.move(1); offset++; return ch; } /** * Returns false. REFilterReader does not support mark() and * reset() methods. */ public boolean markSupported() { return false; } /** Reads from the stream into the provided array. */ public int read(char[] b, int off, int len) { int i; int ok = 0; while (len-- > 0) { i = read(); if (i == -1) return (ok == 0) ? -1 : ok; b[off++] = (char) i; ok++; } return ok; } /** Reads from the stream into the provided array. */ public int read(char[] b) { return read(b,0,b.length); } }