0

I have:

value="my_string"

in my HTML

I want to change this to:

value="my_second_string"

I've tried

~[value="]*?["]~'

This is not working. Could someone please advise me

1
  • 3
    full\real code please Commented Aug 30, 2013 at 4:12

1 Answer 1

2

In regular expressions, [] creates a character class, so your original pattern will match any number v, a, l, u, e, =, or " characters (non-greedily) followed by a single " character.

You can use this pattern to match value="my_string":

 ~value="[^"]*"~

This will match a literal value=" followed by any number of characters other than ", followed by a single " character.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.