bugcoder Posted June 18, 2010 Share Posted June 18, 2010 Too weak with regex statments. what regex statment can work here. have two variables variableOne and variableTwo and i dont want variableOne value to be the part of variableTwo anywhere in it. Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/ Share on other sites More sharing options...
salathe Posted June 18, 2010 Share Posted June 18, 2010 Please ask a question. Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073944 Share on other sites More sharing options...
bugcoder Posted June 18, 2010 Author Share Posted June 18, 2010 well i have asked the question :-\ however if i want to elobrate it with code then its like this username = 'myusername' password = '12myusername89' return /WhatShouldBeHere/i.test(password); what regex statement should be used in above line so that it return false in this case because i dont want username value to be part of password anywhere in it. Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073958 Share on other sites More sharing options...
haku Posted June 18, 2010 Share Posted June 18, 2010 You didn't actually ask a question. You stated a problem. But as to how to deal with that problem: if(password.indexOf(username) != -1) { // match found } You don't need regex for this situation. Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073980 Share on other sites More sharing options...
Maq Posted June 18, 2010 Share Posted June 18, 2010 You don't need a regex for that. var username = 'myusername' var password = '12myusername89' if(password.indexOf(username) != -1) { } else { } Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073981 Share on other sites More sharing options...
haku Posted June 18, 2010 Share Posted June 18, 2010 I saw your post and wondered why the board put your name on my post, until I realized that we both had pretty much exactly the same code Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073983 Share on other sites More sharing options...
Maq Posted June 18, 2010 Share Posted June 18, 2010 I saw your post and wondered why the board put your name on my post, until I realized that we both had pretty much exactly the same code Hate when that happens Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073987 Share on other sites More sharing options...
bugcoder Posted June 18, 2010 Author Share Posted June 18, 2010 Thanks a lot both gurus Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073988 Share on other sites More sharing options...
Maq Posted June 18, 2010 Share Posted June 18, 2010 Thanks a lot both gurus There was actually 3 Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073991 Share on other sites More sharing options...
bugcoder Posted June 18, 2010 Author Share Posted June 18, 2010 oh yeah saw know:D Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1073997 Share on other sites More sharing options...
Maq Posted June 18, 2010 Share Posted June 18, 2010 oh yeah saw know:D Yeah it was just Salathe... no one really cares about him anyway. Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1074000 Share on other sites More sharing options...
bugcoder Posted June 18, 2010 Author Share Posted June 18, 2010 Yeah it was just Salathe... no one really cares about him anyway. here i need guru experience to be part of your laughter:D Link to comment https://forums.phpfreaks.com/topic/205173-regex-statment/#findComment-1074006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.