![]() ![]() ![]() The special syntax \K cancels any match and resets the regex engine working position ![]() Now, the syntax [ searches the greatest non-null range of consecutive characters, different from a single quote and line-breaks chars, followed by a literal opening square bracket Then the part \$ looks for the literal regex symbol $ The beginning of the regex \s searches for the general kind of space character ( the Space or Tabulation chars, the \n or \r line break chars and some others… ) So, we just need to store the text, between square brackets, and surround it with single quotes, during replacement ! On the other hand, the part before square brackets does not change, when moving from the A to the B syntax. We can add the rule that the variable name, before the square brackets does not contain any single quote, too ! Thus, we have to grab any A syntax, specifically, and change it into the B oneĬomparing all syntaxes, it comes that only the A syntax does not contain any single quote character, ' nor the $ symbol, between square brackets. In other words, you just would like that any A) syntax be replaced with the B syntax, wouldn’t you ? Seemingly, I understand that your goal is to obtain the B) syntax, leaving the C) and D syntaxes untouched. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |