Regexmagic Manual in PDF Format
Total Page:16
File Type:pdf, Size:1020Kb
Version 2.11.0 — 20 May 2021 Published by Just Great Software Co. Ltd. Copyright © 2009–2021 Jan Goyvaerts. All rights reserved. “RegexMagic” and “Just Great Software” are trademarks of Jan Goyvaerts i Table of Contents How to Use RegexMagic ...................................................................................... 1 1. Introducing RegexMagic................................................................................................................................................ 3 2. Getting Started with RegexMagic ................................................................................................................................ 4 Creating Regular Expressions with RegexMagic............................................................................................................ 5 3. How to Add Sample Text ............................................................................................................................................. 6 4. How to Create Regular Expressions............................................................................................................................ 7 5. How to Create Capturing Groups and Replacement Text ...................................................................................... 9 6. How to Use Your Regular Expressions .................................................................................................................... 10 RegexMagic Examples ....................................................................................... 11 1. RegexMagic Examples ................................................................................................................................................. 13 2. Pattern: Unicode characters ........................................................................................................................................ 15 3. Pattern: Basic characters .............................................................................................................................................. 16 4. Pattern: Character masks ............................................................................................................................................. 17 5. Pattern: List of literal text ............................................................................................................................................ 18 6. Pattern: Literal text ....................................................................................................................................................... 19 7. Pattern: Literal bytes..................................................................................................................................................... 20 8. Pattern: Control characters ......................................................................................................................................... 21 9. Pattern: Number ........................................................................................................................................................... 22 10. Pattern: Integer ........................................................................................................................................................... 25 11. Pattern: Date and time ............................................................................................................................................... 28 12. Pattern: Email address ............................................................................................................................................... 30 13. Pattern: URL ............................................................................................................................................................... 32 14. Pattern: Country ......................................................................................................................................................... 34 15. Pattern: State or Province ......................................................................................................................................... 36 16. Pattern: Currency ........................................................................................................................................................ 38 17. Pattern: Credit card number ..................................................................................................................................... 40 18. Pattern: National ID .................................................................................................................................................. 43 19. Pattern: VAT number ................................................................................................................................................ 44 20. Pattern: IPv4 Address ................................................................................................................................................ 47 21. Pattern: GUID ............................................................................................................................................................ 50 22. Pattern: Regular expression....................................................................................................................................... 52 23. Pattern: Pattern used by another field ..................................................................................................................... 53 24. Pattern: Text matched by another field .................................................................................................................. 55 25. Pattern: Match anything ............................................................................................................................................ 57 26. Combining Patterns Using Multiple Fields ............................................................................................................ 59 27. Repeating Combined Fields Using a Sequence Field............................................................................................ 61 28. Matching Unrelated Items Using Alternation ........................................................................................................ 64 29. Matching Complex Unrelated Items Using Alternation of Sequences .............................................................. 66 30. Capturing Groups ....................................................................................................................................................... 69 31. Replacing Text Match By Fields with Text Matched by Other Fields ............................................................... 71 32. Typing in Your Own Replacement Text ................................................................................................................ 73 33. Matching Version Numbers ..................................................................................................................................... 75 ii 34. $VAR and ${VAR} Variable Names ...................................................................................................................... 78 35. Matching Something Within Something Else ........................................................................................................ 80 36. Matching Comments in Java Code .......................................................................................................................... 84 37. Increment ImageIndex Constants ........................................................................................................................... 88 RegexMagic Reference ....................................................................................... 93 1. RegexMagic Assistant................................................................................................................................................... 95 2. Samples Panel Reference ............................................................................................................................................. 96 3. Match Panel Reference .............................................................................................................................................. 101 4. Pattern: Pattern used by another field ..................................................................................................................... 108 5. Pattern: Text matched by another field ................................................................................................................... 109 6. Pattern: Match anything............................................................................................................................................. 110 7. Pattern: Unicode characters ...................................................................................................................................... 111 8. Pattern: Basic characters ............................................................................................................................................ 113 9. Pattern: Character masks ........................................................................................................................................... 115 10. Pattern: List of literal text ........................................................................................................................................ 116