Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml regex experiment #503

Closed
TomasVotruba opened this issue Jun 7, 2018 · 2 comments
Closed

Yaml regex experiment #503

TomasVotruba opened this issue Jun 7, 2018 · 2 comments

Comments

@TomasVotruba
Copy link
Member

Since more people asked about this, it deserves reopening

Before we though about using parsing/dumping/modifying ast of yaml #17

Maybe it would be enough to use regular instead.
https://www.google.cz/search?q=regex+replace+word+folowed+by+another+word&oq=regex+replace+word+folowed+by+another+word&aqs=chrome..69i57.15559j0j7&client=ms-android-google&sourceid=chrome-mobile&ie=UTF-8

"key:\s+old_subkey" to "key:\s+new_subkey"

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jun 14, 2018

Main cases?

  • try preg_replace... on first match stop
  • turn to dummy rettors, nothing complex
key:
    another_key: old_value

key:
    anothe_key: new_value

into

key:
    old_key: value

key:
    new_key: value

@TomasVotruba
Copy link
Member Author

Init by #509

TomasVotruba added a commit that referenced this issue Jul 25, 2021
rectorphp/rector-src@34c3e8f [TypeDeclaration] Handle (object) cast on CompleteVarDocTypePropertyRector (#503)
echo511 pushed a commit to echo511/rector that referenced this issue Sep 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant