maqskywalker
asked on
working with regular expressions and jquery
I have this example fiddle:
https://jsfiddle.net/h6vkt3jg/2/
In this example I'm using this regex pattern:
/<\/|\/>/
With this pattern only when you type </ together or /> together does validation pass and the button becomes enabled.
When you run it, it looks like this. The button is disabled.
So if you type the symbols separately that doesn’t pass.
If I type the </ symbols together regardless whether there is text before or after it, validation passes.
If I type the /> symbols together regardless whether there is text before or after it, validation passes.
How do I revised my regex example to do the opposite?
I want to add Not to this regex pattern /<\/|\/>/
So in my example the validation should pass for everything except </ or this />
The tooltip should only popup if I type </ or this />
https://jsfiddle.net/h6vkt3jg/2/
In this example I'm using this regex pattern:
/<\/|\/>/
With this pattern only when you type </ together or /> together does validation pass and the button becomes enabled.
When you run it, it looks like this. The button is disabled.
So if you type the symbols separately that doesn’t pass.
If I type the </ symbols together regardless whether there is text before or after it, validation passes.
If I type the /> symbols together regardless whether there is text before or after it, validation passes.
How do I revised my regex example to do the opposite?
I want to add Not to this regex pattern /<\/|\/>/
So in my example the validation should pass for everything except </ or this />
The tooltip should only popup if I type </ or this />
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER