替换 (xxxxxxx) 之间的所有(包括括号) 的正确预置替换格式是什么。 示例有字符串( 不长) 链接 : AAAABBBB( AAABBBBB)( AAAABBBB)( AAABBBB)( AAAABBBB)( AAAABBBBB), 而我想要的就是 AAAABBBB( AAABBBBB) 。 我需要使用预置替换作为字符串, 并更改字符串长度 。
谢谢 谢谢
替换 (xxxxxxx) 之间的所有(包括括号) 的正确预置替换格式是什么。 示例有字符串( 不长) 链接 : AAAABBBB( AAABBBBB)( AAAABBBB)( AAABBBB)( AAAABBBB)( AAAABBBBB), 而我想要的就是 AAAABBBB( AAABBBBB) 。 我需要使用预置替换作为字符串, 并更改字符串长度 。
谢谢 谢谢
不知道我是否理解你的问题是否正确, 但这应该会将括号中的字符串还回去。
$string = "CCCCC (AAAAABBBBB)";
return preg_replace("(.+(|))","",$string);
此正则将基本上查找后面的字符串( 和单数), 代之以“ ” 。
This is what I ve got for for my RegEx, I was wondering if this is the best way. I want to be able to find something similar regardless of the spacing between Identifiers and not be case sensitive. ...
I made this expression to remove all empty (inluding tags with just whitespace) tags in the page. $content = preg_replace( /<[^/>]*>([s]?)*</[^>]*>/ , , $content); It worked ...
In PHP, I m trying to match the first paragraph tag that is not immediately followed by an <img> tag, and add a class to that paragraph tag. For example, it would add a class to: <p>Text&...
need a simple preg_replace to convert all <br> <br/> and all possible br combinations to <br />. This needs to work in order so i can process a string ie: $output = preg_replace( ,...
I have a "dilema" and wonder what is business best practice. I m using Uploadify to upload images. Now I need to validate the filename before saving the file. I ve looked at different solutions, but ...
I have a text file that I am displaying in a table. I am using preg_match_all to find a specific Title with a specific Chapter and I am replacing the Title and Chapter with preg_replace to make it a ...
I want to change the color of text inside single quotes, but i have also want to change the color of parenthasis as long as they arent in quotes. this is what i have but its not working as planned. "/...
How do I, using preg_replace, replace more than one underscore with just one underscore?