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

(?:\e\[(.*?)m|(\x08)) incorrect #13

Open
molchanov1983 opened this issue Apr 5, 2017 · 1 comment
Open

(?:\e\[(.*?)m|(\x08)) incorrect #13

molchanov1983 opened this issue Apr 5, 2017 · 1 comment

Comments

@molchanov1983
Copy link

string = '� �� ��[KGi0/0/0/8 admin-down admin-down '
Output after replacing = in-down admin-down (Gi0/0/0/8 is lost)

[31] => Array
(
[0] => color
[1] => KGi0/0/0/8 ad
)

@rin-nas
Copy link

rin-nas commented Nov 22, 2017

use this:
preg_match_all('/(?:\\\e\\[(.*?)m|(\\x08))/', $text, $matches, PREG_OFFSET_CAPTURE);

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

2 participants