What is the RegEx for finding a semi-color between brackets? - Wordpress Solution
[Solved] - What is the RegEx for finding a semi-color between brackets? - Wordpress Solution |
---|
Try following codes |
Not really a WordPress expression, but surely you PHP geniuses can help. Assume I have text like this:
or: or: I need to remove every semi-colon that appears between the double square brackets [[ ]]. What is the regular expression for this? This will be in a script that is looping hundreds of small text snippets like the ones above. Solution - 1
Solution - 2These methods above let you replace one semicolon only. Here is the code to remove all semicolons:
Solution - 3ex: From : [123]some text [caught] more text [123123] sq() [] you get : [123] [caught] [123123] [] using this reg expression: \[[^\]|^\[]*\] the following will match () \(([^\}]+)\) Solution - 4Hi Lawrence, Just replace the match for this: Edit: removed the double quote on my first answer to match all occurrences of ";" inside the [[]] |
Date: 2022-10-21 05:18:39 |
Category: Wordpress |